RefCell is neither mutable nor immutable. It’s a type like any other. What is special about RefCell is that it has a method like:
fn borrow_mut(&self) -> &mut T
Which means you can get a mutable reference to its contents by only having a normal reference to the RefCell.
By pointers I mean raw pointers. The pointers themselves are not unsafe. They are just normal pointers like you would have in C.
Rc can be used to generate weak refs. Which is what you want for your tree.
I don’t know about servo. So I can’t tell you much about it.
Don’t hope too much about the temporary unsafe thing. It’s not practical (maybe impossible) to make a safety checker that checks the entire program. The practical way is to make safe abstractions using unsafe code. For example rust itself is built upon plenty of unsafe code, however, it provides to you the appropriate abstractions so what you do is safe.
In this case. You can have a bit of unsafe code on your tree, so that the users of that tree have a safe API to do something that you needed unsafe code for.
For example one of the cases where you cannot automatically check the safety is in dereferencing a raw pointer returned by a FFI function call to a dynamic library. Your automatic safety checker would need to be able to read the library’s documentation. And at that point it’s not a real safety checker because the documentation may lie or have bugs.
The difference is that this way it’s much easier to calculate prices.
If the tax were 20%, the exporter would have to do the inverse calculation. That is, “which price will result in me gaining $1000?” Which is not 1200, since 20% of 1200 is 240. x = 0.8y -> y = (1/0.8)*x -> y = 1.25x. so the exporter would have to price it at 1.25x the price, $1250. 20% of 1250 is 250.
So it’s unintuitive that a 20% tax would result in a 25% price increase. That’s my guess why tariffs are applied to the importer instead of exporter.