pub struct SimpleHandler<T>(pub T);Expand description
A wrapper struct that adapts an AsyncHandler to the Handler trait.
Tuple Fields§
§0: TTrait Implementations§
Source§impl<T: AsyncHandler> Handler for SimpleHandler<T>
impl<T: AsyncHandler> Handler for SimpleHandler<T>
fn handle<'life0, 'async_trait>(
&'life0 self,
msg: CanonicalMessage,
) -> Pin<Box<dyn Future<Output = Result<Handled, HandlerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_many<'life0, 'async_trait>(
&'life0 self,
msgs: Vec<CanonicalMessage>,
) -> Pin<Box<dyn Future<Output = Vec<Result<Handled, HandlerError>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl<T> Freeze for SimpleHandler<T>where
T: Freeze,
impl<T> RefUnwindSafe for SimpleHandler<T>where
T: RefUnwindSafe,
impl<T> Send for SimpleHandler<T>where
T: Send,
impl<T> Sync for SimpleHandler<T>where
T: Sync,
impl<T> Unpin for SimpleHandler<T>where
T: Unpin,
impl<T> UnsafeUnpin for SimpleHandler<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for SimpleHandler<T>where
T: UnwindSafe,
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