Skip to main content

Msg

Trait Msg 

Source
pub trait Msg:
    Any
    + Send
    + Sync
    + Debug {
    // Required methods
    fn as_any(&self) -> &dyn Any;
    fn into_any(self: Box<Self>) -> Box<dyn Any>;
}
Expand description

Msg represents an event message delivered to the Model’s Update function.

Required Methods§

Source

fn as_any(&self) -> &dyn Any

Helper to downcast to Any.

Source

fn into_any(self: Box<Self>) -> Box<dyn Any>

Consumes the boxed message and returns it as a Box<dyn Any>, so the program can move the concrete message out of the trait object (used to dispatch the commands carried by BatchMsg/SequenceMsg).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<T: Any + Send + Sync + Debug> Msg for T