pub struct ActionDispatch<A, S, C> { /* private fields */ }Expand description
Action Dispatch. Encasulate epic logic in a single future.
Implementations§
Source§impl<A, S, C> ActionDispatch<A, S, C>
impl<A, S, C> ActionDispatch<A, S, C>
Sourcepub fn execute<F, Fut>(
actions: Actions<A, S, C>,
spawner: TaskSpawner,
f: F,
) -> impl Stream<Item = Result<A, Error>>
pub fn execute<F, Fut>( actions: Actions<A, S, C>, spawner: TaskSpawner, f: F, ) -> impl Stream<Item = Result<A, Error>>
Execute a stateful futures that dispatches/reacts to actions.
Sourcepub fn execute_with_response<F, Fut, R, O, E>(
actions: Actions<A, S, C>,
spawner: TaskSpawner,
f: F,
response: R,
) -> impl Stream<Item = Result<A, Error>>
pub fn execute_with_response<F, Fut, R, O, E>( actions: Actions<A, S, C>, spawner: TaskSpawner, f: F, response: R, ) -> impl Stream<Item = Result<A, Error>>
Execute a stateful futures that dispatches/reacts to actions with an final result action.
Sourcepub fn dispatch(&self, item: A) -> bool
pub fn dispatch(&self, item: A) -> bool
Dispatch an action. Actions are dispatched immediately.
Sourcepub fn dispatch_result(&self, item: Result<A, Error>) -> bool
pub fn dispatch_result(&self, item: Result<A, Error>) -> bool
Dispatch an action result. Actions are dispatched immediately.
Trait Implementations§
Auto Trait Implementations§
impl<A, S, C> Freeze for ActionDispatch<A, S, C>
impl<A, S, C> !RefUnwindSafe for ActionDispatch<A, S, C>
impl<A, S, C> Send for ActionDispatch<A, S, C>where
A: Send,
impl<A, S, C> Sync for ActionDispatch<A, S, C>where
A: Send,
impl<A, S, C> Unpin for ActionDispatch<A, S, C>
impl<A, S, C> UnsafeUnpin for ActionDispatch<A, S, C>
impl<A, S, C> !UnwindSafe for ActionDispatch<A, S, C>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more