pub struct Action<I, T>where
T: 'static,{ /* private fields */ }prelude only.Expand description
A handle to an async action created by use_action.
Call it with .call(...) to dispatch work, read results with .value(),
and check progress with .pending(). Implements Copy so it can be moved
into multiple event handlers freely.
Implementations§
Source§impl<I, O> Action<I, O>where
I: 'static,
O: 'static,
impl<I, O> Action<I, O>where
I: 'static,
O: 'static,
Sourcepub fn value(&self) -> Option<Result<ReadSignal<O>, CapturedError>>
pub fn value(&self) -> Option<Result<ReadSignal<O>, CapturedError>>
The result of the most recent call, if it has completed.
Returns None while the action is pending or has never been called.
Returns Some(Ok(signal)) on success or Some(Err(e)) on failure.
The returned ReadSignal is reactive — reading it in RSX will
subscribe the component to updates.
Source§impl<Out> Action<(), Out>
impl<Out> Action<(), Out>
Sourcepub fn call(&mut self) -> Dispatching<()> ⓘ
pub fn call(&mut self) -> Dispatching<()> ⓘ
Dispatch the action with no arguments.
Source§impl<A, Out> Action<(A,), Out>where
A: 'static,
impl<A, Out> Action<(A,), Out>where
A: 'static,
Sourcepub fn call(&mut self, A: A) -> Dispatching<()> ⓘ
pub fn call(&mut self, A: A) -> Dispatching<()> ⓘ
Dispatch the action with the given arguments.
Source§impl<A, B, Out> Action<(A, B), Out>where
A: 'static,
B: 'static,
impl<A, B, Out> Action<(A, B), Out>where
A: 'static,
B: 'static,
Sourcepub fn call(&mut self, A: A, B: B) -> Dispatching<()> ⓘ
pub fn call(&mut self, A: A, B: B) -> Dispatching<()> ⓘ
Dispatch the action with the given arguments.
Source§impl<A, B, C, Out> Action<(A, B, C), Out>where
A: 'static,
B: 'static,
C: 'static,
impl<A, B, C, Out> Action<(A, B, C), Out>where
A: 'static,
B: 'static,
C: 'static,
Sourcepub fn call(&mut self, A: A, B: B, C: C) -> Dispatching<()> ⓘ
pub fn call(&mut self, A: A, B: B, C: C) -> Dispatching<()> ⓘ
Dispatch the action with the given arguments.
Source§impl<A, B, C, D, Out> Action<(A, B, C, D), Out>where
A: 'static,
B: 'static,
C: 'static,
D: 'static,
impl<A, B, C, D, Out> Action<(A, B, C, D), Out>where
A: 'static,
B: 'static,
C: 'static,
D: 'static,
Sourcepub fn call(&mut self, A: A, B: B, C: C, D: D) -> Dispatching<()> ⓘ
pub fn call(&mut self, A: A, B: B, C: C, D: D) -> Dispatching<()> ⓘ
Dispatch the action with the given arguments.
Source§impl<A, B, C, D, E, Out> Action<(A, B, C, D, E), Out>where
A: 'static,
B: 'static,
C: 'static,
D: 'static,
E: 'static,
impl<A, B, C, D, E, Out> Action<(A, B, C, D, E), Out>where
A: 'static,
B: 'static,
C: 'static,
D: 'static,
E: 'static,
Sourcepub fn call(&mut self, A: A, B: B, C: C, D: D, E: E) -> Dispatching<()> ⓘ
pub fn call(&mut self, A: A, B: B, C: C, D: D, E: E) -> Dispatching<()> ⓘ
Dispatch the action with the given arguments.
Source§impl<A, B, C, D, E, F, Out> Action<(A, B, C, D, E, F), Out>where
A: 'static,
B: 'static,
C: 'static,
D: 'static,
E: 'static,
F: 'static,
impl<A, B, C, D, E, F, Out> Action<(A, B, C, D, E, F), Out>where
A: 'static,
B: 'static,
C: 'static,
D: 'static,
E: 'static,
F: 'static,
Sourcepub fn call(&mut self, A: A, B: B, C: C, D: D, E: E, F: F) -> Dispatching<()> ⓘ
pub fn call(&mut self, A: A, B: B, C: C, D: D, E: E, F: F) -> Dispatching<()> ⓘ
Dispatch the action with the given arguments.
Trait Implementations§
impl<I, T> Copy for Action<I, T>
Auto Trait Implementations§
impl<I, T> Freeze for Action<I, T>
impl<I, T> !RefUnwindSafe for Action<I, T>
impl<I, T> !Send for Action<I, T>
impl<I, T> !Sync for Action<I, T>
impl<I, T> Unpin for Action<I, T>where
T: Unpin,
impl<I, T> UnsafeUnpin for Action<I, T>
impl<I, T> !UnwindSafe for Action<I, T>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
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>
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>
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