pub struct LifeRc<T: Life> { /* private fields */ }Expand description
Lifetime-bounding reference-counting pointer.
This reference pointer is just like
std::rc::Rc. The pointee t: Obj<'a>,
will be wrapped into LifeRc<Obj<'a>>,
therefore any LifeRc<'a> of t will
not be able to outlives lifetime 'a.
The purpose of this pointer type is to
control the weak pointers LifeWeak.
We forbid upgrading LifeWeak back to
LifeRc, and allow only using
LifeWeak::with to access the currently
available reference to t. If all
LifeRc created for t has gone
out of scope, then none of these
LifeWeak::with will be able
to acquire a reference to t.
This pointer works only under
single-threaded context, and is immutable
after creation as it can be shared (this
is the same as std::rc::Rc). You
must cope with std::cell::RefCell
and interior mutability if you want
to mutate the pointee.
Check the premises of in the module level documentation to see the constraints about this pointer.