Open vi opened 8 years ago
Hi, I'm sincerely sorry for taking so long to respond.
I've added a section in the docs about a motivating example of normal Rust code that would not compile and where this library could help, it is included in the next release.
Writing up more detailed use case scenarios sounds like a good idea too, but I did not get to that right now.
My reactions when reading the doc:
Strange idea... Why not just use usual reference or the object itself?
What does mean to re-creating a reference? Can there be only one OwningRef to given object? Is it Rc, but for references?
Maybe there should be some easy introduction and rationale. There may also be a "nonworking" example where we can't do something, neither with usual references nor the object itself (showing partial source code with unfilled "impossible" line), but can with OwningRef (showing corrected, now working source code).
Is OwningRef to provide a limited "view" into subset of the object while preserving ownership? In that case there may be special example showing how OwningRef simplifies API like this: