pub trait IMessageHandler {
    // Required methods
    fn id(&self) -> i32;
    fn process_message(&mut self, message: &Message) -> MessageReturnTypes;
    fn to_string(&self) -> String;
}
Expand description

Represents a handler in a chain of handlers. All objects that participate in the HandlerChain class must implement this trait.

Required Methods§

source

fn id(&self) -> i32

ID of the window. This is used to uniquely identify a window in the collection.

source

fn process_message(&mut self, message: &Message) -> MessageReturnTypes

Called with a message for the window.

Parameters
  • message

    Message object representing the message to process.

Returns

Returns a value from the MessageReturnTypes enumeration indicating what action the caller should take: (Stop) This message was handled and processing should stop, (Continue) this message can be passed on to other handlers, or (Close) this handler is closed so remove from the handlers list and stop further processing.

source

fn to_string(&self) -> String

Return a string representation of the message handler.

Implementors§