AppWorld

Trait AppWorld 

Source
pub trait AppWorld: Sized {
    type Message;

    // Required method
    fn msg(&mut self, message: Self::Message);
}
Expand description

Defines how messages that indicate that something has happened get sent to the World.

Required Associated Types§

Source

type Message

Indicates that something has happened.

#[allow(unused)]
enum MyMessageType {
    IncreaseClickCounter,
    SetLastPausedAt(SystemTime)
}

Required Methods§

Source

fn msg(&mut self, message: Self::Message)

Send a message to the state object. This will usually lead to a state update

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§