I understand references, Rc and Arc. But wtf is ARef and why would I need one?
Imagine you have a function that sometimes:
- Returns a borrowed
&str
(no heap allocation) - Returns an owned
String
you just built - Returns a shared buffer (e.g. an
Rc<String>
) without copying