Trait MessageHandler

Source
pub trait MessageHandler: Any {
    // Required methods
    fn id(&self) -> Ustr;
    fn handle(&self, message: &dyn Any);
    fn as_any(&self) -> &dyn Any;
}

Required Methods§

Source

fn id(&self) -> Ustr

Returns the unique identifier for this handler.

Source

fn handle(&self, message: &dyn Any)

Handles a message of any type.

Source

fn as_any(&self) -> &dyn Any

Returns this handler as a trait object.

Trait Implementations§

Source§

impl PartialEq for dyn MessageHandler

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

const fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for dyn MessageHandler

Implementors§