pub struct UnSubNoop { /* private fields */ }Expand description
A no-operation unsubscribe handler.
UnSubNoop is a simple implementation of UnSubTrait
that performs no operations when unsubscribe is called.
Depending on how it is configured, unsubscribe will either:
- Return
Ok(())without taking any action whenshould_errisfalse - Return
Err(UnSubError::NoHandler)whenshould_erristrue
This is useful for:
- Default implementations where unsubscribe is not required
- Testing and mocking scenarios
- Cases where subscription cleanup is not necessary
Implementations§
Trait Implementations§
Source§impl UnSubTrait for UnSubNoop
impl UnSubTrait for UnSubNoop
Source§fn unsubscribe<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), UnSubError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn unsubscribe<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), UnSubError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Performs a no-operation unsubscribe.
Returns Err(UnSubError::NoHandler) if should_err is true,
otherwise returns Ok(()).
§Returns
Returns Err(UnSubError::NoHandler) if should_err is true,
otherwise returns Ok(()).
Auto Trait Implementations§
impl Freeze for UnSubNoop
impl RefUnwindSafe for UnSubNoop
impl Send for UnSubNoop
impl Sync for UnSubNoop
impl Unpin for UnSubNoop
impl UnsafeUnpin for UnSubNoop
impl UnwindSafe for UnSubNoop
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