pub struct AutoReleaseDispatcher(/* private fields */);Expand description
An owned reference to a driver runtime dispatcher that auto-releases when dropped. This gives
you the best of both worlds of having an Arc<Dispatcher> and a DispatcherRef<'static>
created by Dispatcher::release:
- You can vend
Weak-like pointers to it that will not cause memory access errors if used after the dispatcher has shut down, like anArc. - You can tie its terminal lifetime to that of the driver itself.
This is particularly useful in tests.
Trait Implementations§
Source§impl Debug for AutoReleaseDispatcher
impl Debug for AutoReleaseDispatcher
Source§impl Drop for AutoReleaseDispatcher
impl Drop for AutoReleaseDispatcher
Source§impl From<&AutoReleaseDispatcher> for WeakDispatcher
impl From<&AutoReleaseDispatcher> for WeakDispatcher
Source§fn from(value: &AutoReleaseDispatcher) -> Self
fn from(value: &AutoReleaseDispatcher) -> Self
Converts to this type from the input type.
Source§impl From<Dispatcher> for AutoReleaseDispatcher
impl From<Dispatcher> for AutoReleaseDispatcher
Source§fn from(value: Dispatcher) -> Self
fn from(value: Dispatcher) -> Self
Converts to this type from the input type.
impl Send for AutoReleaseDispatcher
impl Sync for AutoReleaseDispatcher
Auto Trait Implementations§
impl Freeze for AutoReleaseDispatcher
impl RefUnwindSafe for AutoReleaseDispatcher
impl Unpin for AutoReleaseDispatcher
impl UnwindSafe for AutoReleaseDispatcher
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