pub struct DynamicHandlerGuard<R: Role> { /* private fields */ }Expand description
A guard that keeps a dynamic message handler registered.
Dropping the guard unregisters the handler. Use detach to
keep the handler registered for the remaining lifetime of the connection.
Implementations§
Source§impl<R: Role> DynamicHandlerGuard<R>
impl<R: Role> DynamicHandlerGuard<R>
Sourcepub fn detach(self)
pub fn detach(self)
Keep the dynamic handler registered after this guard is dropped.
The handler remains registered until the connection itself shuts down.
Unlike leaking the guard, detaching does not retain an extra
ConnectionTo handle.
Trait Implementations§
Source§impl<R: Role> Drop for DynamicHandlerGuard<R>
impl<R: Role> Drop for DynamicHandlerGuard<R>
Auto Trait Implementations§
impl<R> !RefUnwindSafe for DynamicHandlerGuard<R>
impl<R> !UnwindSafe for DynamicHandlerGuard<R>
impl<R> Freeze for DynamicHandlerGuard<R>where
R: Freeze,
impl<R> Send for DynamicHandlerGuard<R>
impl<R> Sync for DynamicHandlerGuard<R>
impl<R> Unpin for DynamicHandlerGuard<R>where
R: Unpin,
impl<R> UnsafeUnpin for DynamicHandlerGuard<R>where
R: 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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoMaybeUndefined<T> for T
impl<T> IntoMaybeUndefined<T> for T
Source§fn into_maybe_undefined(self) -> MaybeUndefined<T>
fn into_maybe_undefined(self) -> MaybeUndefined<T>
Converts this value into a three-state builder argument.
Source§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Converts this value into an optional builder argument.