pub struct Action<I: 'static, O: 'static> { /* private fields */ }Expand description
An async operation and its state: action.
Implementations§
Source§impl<I: 'static, O: 'static> Action<I, O>
impl<I: 'static, O: 'static> Action<I, O>
Sourcepub fn dispatch(&self, input: I)
pub fn dispatch(&self, input: I)
Runs the action with input. Dispatches may overlap; the value is
the result of the latest one.
Sourcepub fn value(&self) -> Option<O>where
O: Clone,
pub fn value(&self) -> Option<O>where
O: Clone,
The result of the latest dispatch, once it finished.
Sourcepub fn with_value<R>(&self, f: impl FnOnce(Option<&O>) -> R) -> R
pub fn with_value<R>(&self, f: impl FnOnce(Option<&O>) -> R) -> R
Borrows the result of the latest dispatch.
Trait Implementations§
impl<I: 'static, O: 'static> Copy for Action<I, O>
Auto Trait Implementations§
impl<I, O> Forget for Action<I, O>
impl<I, O> Freeze for Action<I, O>
impl<I, O> RefUnwindSafe for Action<I, O>
impl<I, O> Send for Action<I, O>
impl<I, O> Sync for Action<I, O>
impl<I, O> Unpin for Action<I, O>
impl<I, O> UnsafeUnpin for Action<I, O>
impl<I, O> UnwindSafe for Action<I, O>
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