[go: up one dir, main page]

Process

Trait Process 

Source
pub trait Process: Sender + AsRef<Channel> {
    // Required method
    fn process_one(&self, msg: Message);

    // Provided method
    fn process_all(&self) { ... }
}
Expand description

Internal helper trait, implemented for connections that process incoming messages.

Required Methods§

Source

fn process_one(&self, msg: Message)

Dispatches a message.

Provided Methods§

Source

fn process_all(&self)

Dispatches all pending messages, without blocking.

This is usually called from the reactor only, after read_write. Despite this taking &self and not “&mut self”, it is a logic error to call this recursively or from more than one thread at a time.

Implementors§