pub struct ChannelEventSource<Event> { /* private fields */ }Expand description
A channel-based event source that receives events from a Tokio MPSC channel
Implementations§
Source§impl<Event> ChannelEventSource<Event>where
Event: Send + 'static,
impl<Event> ChannelEventSource<Event>where
Event: Send + 'static,
Trait Implementations§
Source§impl<Event, Context, Action> EventDrivenNode<Event, Context, Action> for ChannelEventSource<Event>
impl<Event, Context, Action> EventDrivenNode<Event, Context, Action> for ChannelEventSource<Event>
Source§fn wait_for_event<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Event, FloxideError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn wait_for_event<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Event, FloxideError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Wait for an external event to occur
Source§fn process_event<'life0, 'life1, 'async_trait>(
&'life0 self,
_event: Event,
_ctx: &'life1 mut Context,
) -> Pin<Box<dyn Future<Output = Result<Action, FloxideError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn process_event<'life0, 'life1, 'async_trait>(
&'life0 self,
_event: Event,
_ctx: &'life1 mut Context,
) -> Pin<Box<dyn Future<Output = Result<Action, FloxideError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Process the received event and update context
Auto Trait Implementations§
impl<Event> Freeze for ChannelEventSource<Event>
impl<Event> RefUnwindSafe for ChannelEventSource<Event>
impl<Event> Send for ChannelEventSource<Event>where
Event: Send,
impl<Event> Sync for ChannelEventSource<Event>where
Event: Send,
impl<Event> Unpin for ChannelEventSource<Event>
impl<Event> UnsafeUnpin for ChannelEventSource<Event>
impl<Event> UnwindSafe for ChannelEventSource<Event>
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