Skip to content

Why do the setters on MediaRecorderOptions take &mut self? #3440

Closed Answered by daxpedda
allsey87 asked this question in Q&A
Discussion options

You must be logged in to vote

This using a builder pattern is probably not the best API design.

What you have to keep in mind is that JsValues are just references to things that live in the JS runtime. cloneing doesn't actually clone the data, it just clones the reference.

You don't really have to be concerned about exclusive access because MediaRecorderOptions isn't Send or Sync, so it can never be called from two places at the same time.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@allsey87
Comment options

@daxpedda
Comment options

@allsey87
Comment options

Answer selected by daxpedda
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants