Skip to main content

Command

Trait Command 

Source
pub trait Command<S>: 'static {
    type Output: 'static;

    // Required method
    fn run(
        self,
        state: S,
    ) -> impl Future<Output = Result<Self::Output, RouteError>> + 'static;

    // Provided method
    fn refreshes(&self) -> Vec<String> { ... }
}
Expand description

An async mutation that views start with CommandHandle::run.

Required Associated Types§

Source

type Output: 'static

Required Methods§

Source

fn run( self, state: S, ) -> impl Future<Output = Result<Self::Output, RouteError>> + 'static

Carries out the mutation, with a clone of the app state.

Provided Methods§

Source

fn refreshes(&self) -> Vec<String>

The keys to invalidate once the command succeeded, rerunning the loads and queries that depend on them.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§