pub struct AsyncCallbackManager<Bkend, Cstrnt> { /* private fields */ }Implementations§
Source§impl<Bkend, Cstrnt: PartialEq> AsyncCallbackManager<Bkend, Cstrnt>
impl<Bkend, Cstrnt: PartialEq> AsyncCallbackManager<Bkend, Cstrnt>
pub fn with_on_task_received_callback( self, cb: impl FnMut(TaskInformation<'_, Cstrnt>) + 'static, ) -> Self
pub fn with_on_response_received_callback( self, cb: impl FnMut(ResponseInformation) + 'static, ) -> Self
Sourcepub fn new_sender<Frntend>(
&mut self,
channel_size: usize,
) -> AsyncCallbackSender<Bkend, Frntend, Cstrnt>
pub fn new_sender<Frntend>( &mut self, channel_size: usize, ) -> AsyncCallbackSender<Bkend, Frntend, Cstrnt>
Creates a new AsyncCallbackSender that sends to this Manager. Channel size refers to number of number of state mutations that can be buffered from tasks.
Sourcepub async fn manage_next_event(
&mut self,
backend: &Bkend,
) -> Option<ManagedEventType>
pub async fn manage_next_event( &mut self, backend: &Bkend, ) -> Option<ManagedEventType>
Manage the next event in the queue. Combination of spawn_next_task and process_next_response. Returns Some(ManagedEventType), if something was processed. Returns None, if no senders or tasks exist.
Sourcepub async fn spawn_next_task(&mut self, backend: &Bkend) -> Option<()>
pub async fn spawn_next_task(&mut self, backend: &Bkend) -> Option<()>
Spawns the next incoming task from a sender. Returns Some(()), if a task was spawned. Returns None, if no senders.
Sourcepub async fn process_next_response(&mut self) -> Option<ResponseInformation>
pub async fn process_next_response(&mut self) -> Option<ResponseInformation>
Spawns the next incoming task from a sender. Returns Some(ResponseInformation), if a task was spawned. Returns None, if no senders. Note that the ‘on_next_response’ callback is not called, you’re given the ResponseInformation directly.
Trait Implementations§
Auto Trait Implementations§
impl<Bkend, Cstrnt> Freeze for AsyncCallbackManager<Bkend, Cstrnt>
impl<Bkend, Cstrnt> !RefUnwindSafe for AsyncCallbackManager<Bkend, Cstrnt>
impl<Bkend, Cstrnt> !Send for AsyncCallbackManager<Bkend, Cstrnt>
impl<Bkend, Cstrnt> !Sync for AsyncCallbackManager<Bkend, Cstrnt>
impl<Bkend, Cstrnt> Unpin for AsyncCallbackManager<Bkend, Cstrnt>where
Cstrnt: Unpin,
impl<Bkend, Cstrnt> !UnwindSafe for AsyncCallbackManager<Bkend, Cstrnt>
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