async_callback_manager

Struct AsyncTask

Source
pub struct AsyncTask<Frntend, Bkend, Md> { /* private fields */ }
Expand description

An asynchrnonous task that can generate state mutations and/or more tasks to be spawned by an AsyncCallbackManager.

Implementations§

Source§

impl<Frntend, Bkend, Md> AsyncTask<Frntend, Bkend, Md>

Source

pub fn push( self, next: AsyncTask<Frntend, Bkend, Md>, ) -> AsyncTask<Frntend, Bkend, Md>

Source

pub fn new_no_op() -> AsyncTask<Frntend, Bkend, Md>

Source

pub fn new_future<R>( request: R, handler: impl FnOnce(&mut Frntend, R::Output) + Send + 'static, constraint: Option<Constraint<Md>>, ) -> AsyncTask<Frntend, Bkend, Md>
where R: BackendTask<Bkend, MetadataType = Md> + Debug + 'static, Bkend: 'static, Frntend: 'static,

Source

pub fn new_future_chained<R>( request: R, handler: impl FnOnce(&mut Frntend, R::Output) -> AsyncTask<Frntend, Bkend, Md> + Send + 'static, constraint: Option<Constraint<Md>>, ) -> AsyncTask<Frntend, Bkend, Md>
where R: BackendTask<Bkend, MetadataType = Md> + Debug + 'static, Bkend: 'static, Frntend: 'static,

Source

pub fn new_stream<R>( request: R, handler: impl FnOnce(&mut Frntend, R::Output) + Send + Clone + 'static, constraint: Option<Constraint<Md>>, ) -> AsyncTask<Frntend, Bkend, Md>
where R: BackendStreamingTask<Bkend, MetadataType = Md> + Debug + 'static, Bkend: 'static, Frntend: 'static,

Source

pub fn new_stream_chained<R>( request: R, handler: impl FnOnce(&mut Frntend, R::Output) -> AsyncTask<Frntend, Bkend, Md> + Send + Clone + 'static, constraint: Option<Constraint<Md>>, ) -> AsyncTask<Frntend, Bkend, Md>
where R: BackendStreamingTask<Bkend, MetadataType = Md> + Debug + 'static, Bkend: 'static, Frntend: 'static,

Source

pub fn map<NewFrntend>( self, f: impl Fn(&mut NewFrntend) -> &mut Frntend + Clone + Send + 'static, ) -> AsyncTask<NewFrntend, Bkend, Md>
where Bkend: 'static, Frntend: 'static, Md: 'static,

§Warning

This is recursive, if you have set up a cycle of AsyncTasks, map may overflow.

Trait Implementations§

Source§

impl<Frntend, Bkend, Md> FromIterator<AsyncTask<Frntend, Bkend, Md>> for AsyncTask<Frntend, Bkend, Md>

Source§

fn from_iter<T: IntoIterator<Item = AsyncTask<Frntend, Bkend, Md>>>( iter: T, ) -> Self

Creates a value from an iterator. Read more

Auto Trait Implementations§

§

impl<Frntend, Bkend, Md> Freeze for AsyncTask<Frntend, Bkend, Md>
where Md: Freeze,

§

impl<Frntend, Bkend, Md> !RefUnwindSafe for AsyncTask<Frntend, Bkend, Md>

§

impl<Frntend, Bkend, Md> !Send for AsyncTask<Frntend, Bkend, Md>

§

impl<Frntend, Bkend, Md> !Sync for AsyncTask<Frntend, Bkend, Md>

§

impl<Frntend, Bkend, Md> Unpin for AsyncTask<Frntend, Bkend, Md>
where Md: Unpin,

§

impl<Frntend, Bkend, Md> !UnwindSafe for AsyncTask<Frntend, Bkend, Md>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.