pub enum EventHandler<Rp: RoutableProtocol + 'static> {
Sync(fn(&mut Context<Rp>) -> DceResult<()>),
Async(Box<dyn for<'a> Fn(&'a mut Context<Rp>) -> Pin<Box<dyn Future<Output = DceResult<()>> + Send + 'a>> + Send + Sync>),
}Variants§
Sync(fn(&mut Context<Rp>) -> DceResult<()>)
Async(Box<dyn for<'a> Fn(&'a mut Context<Rp>) -> Pin<Box<dyn Future<Output = DceResult<()>> + Send + 'a>> + Send + Sync>)
Trait Implementations§
Auto Trait Implementations§
impl<Rp> Freeze for EventHandler<Rp>
impl<Rp> !RefUnwindSafe for EventHandler<Rp>
impl<Rp> Send for EventHandler<Rp>
impl<Rp> Sync for EventHandler<Rp>
impl<Rp> Unpin for EventHandler<Rp>
impl<Rp> !UnwindSafe for EventHandler<Rp>
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