-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mutability in web-sys #1061
Comments
A good question! Currently everything takes |
Thanks! Then I guess multiple threads/workers could simply fetch multiple references to the same object and mutate it in parallel, without data races happening. Feels strange to modify a non-mut object in a Rust code base, but you're right that it doesn't make sense to limit borrowing if it's not necessary 🙂 |
@dbrgn We could use In other words, because Rust cannot guarantee that JS won't write to the object, using As for multiple threads/workers, that's a much trickier situation, which we haven't fully figured out yet. It might involve a |
I noticed that some methods on
Range
(e.g. set_start_before) accept a&self
reference, even though the state on the range is changed by that method. Shouldn't those require a mutable reference? Or are all DOM objects treated as having interior mutability?The text was updated successfully, but these errors were encountered: