Skip to main content

FallibleModelExt

Trait FallibleModelExt 

Source
pub trait FallibleModelExt: FallibleModel {
    // Provided methods
    fn update_with_error_handling(
        &mut self,
        event: Event<Self::Message>,
    ) -> Cmd<Self::Message> { ... }
    fn update_with_panic_catching(
        &mut self,
        event: Event<Self::Message>,
    ) -> Cmd<Self::Message> { ... }
}
Expand description

Helper trait to make it easier to use FallibleModel in the Program

Provided Methods§

Source

fn update_with_error_handling( &mut self, event: Event<Self::Message>, ) -> Cmd<Self::Message>

Perform a fallible update with automatic error handling

This method combines try_update and handle_error for convenience.

Source

fn update_with_panic_catching( &mut self, event: Event<Self::Message>, ) -> Cmd<Self::Message>

Perform an update with panic catching

This method catches panics during update and converts them to errors.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<T: FallibleModel> FallibleModelExt for T

Automatically implement FallibleModelExt for all FallibleModel types