Skip to main content

StateExt

Trait StateExt 

Source
pub trait StateExt: Sized {
    // Provided methods
    fn updated(self, cmd: Command<impl Clone>) -> UpdateResult<Self, impl Clone> { ... }
    fn unchanged(self) -> UpdateResult<Self, ()> { ... }
}
Expand description

Extension trait for ergonomic state updates.

Provided Methods§

Source

fn updated(self, cmd: Command<impl Clone>) -> UpdateResult<Self, impl Clone>

Updates self and returns a command.

Source

fn unchanged(self) -> UpdateResult<Self, ()>

Returns self with no command.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T> StateExt for T