pub struct RefCountedRegistry<K, O = ()>(/* private fields */);Expand description
RefCountedRegistry<Key, Options>: the first registration of a key runs
the activation; what it returned runs once the last registration of
that key is released. A handle; cloning it shares the registry.
Implementations§
Source§impl<K: PartialEq + Clone + 'static, O: 'static> RefCountedRegistry<K, O>
impl<K: PartialEq + Clone + 'static, O: 'static> RefCountedRegistry<K, O>
Sourcepub fn register(&self, key: K, options: Option<O>) -> Unregister
pub fn register(&self, key: K, options: Option<O>) -> Unregister
register(key, options): registers key and returns its disposer.
options are read only by the activating (first) registration of
the key. A stale disposer (one called after the registry was
disposed or the key registered again) does nothing.
Trait Implementations§
Auto Trait Implementations§
impl<K, O = ()> !RefUnwindSafe for RefCountedRegistry<K, O>
impl<K, O = ()> !Send for RefCountedRegistry<K, O>
impl<K, O = ()> !Sync for RefCountedRegistry<K, O>
impl<K, O = ()> !UnwindSafe for RefCountedRegistry<K, O>
impl<K, O> Forget for RefCountedRegistry<K, O>
impl<K, O> Freeze for RefCountedRegistry<K, O>
impl<K, O> Move for RefCountedRegistry<K, O>
impl<K, O> Unpin for RefCountedRegistry<K, O>
impl<K, O> UnsafeUnpin for RefCountedRegistry<K, O>where
Rc<Inner<K, O>>: UnsafeUnpin,
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