pub struct Retain(/* private fields */);Expand description
A metadata key that retains a value for its lifetime.
This is useful for keeping watcher guards, subscriptions, or other values alive as long as the view exists. The retained value is dropped when the view is dropped.
This type implements MetadataKey and is used with Metadata,
so renderers must handle it (by extracting content and keeping the value alive).
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Retain
impl !RefUnwindSafe for Retain
impl !Send for Retain
impl !Sync for Retain
impl Unpin for Retain
impl !UnwindSafe for Retain
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more