Enum thrust::reactor::Message [] [src]

pub enum Message {
    Connect(SocketAddr, Sender<Id>, Sender<Dispatch>),
    Bind(SocketAddr, Sender<Id>, Sender<Dispatch>),
    Rpc(Token, Vec<u8>),
    Shutdown,
}

Communication into the Mio event loop happens with a Message. For each new Mio event loop, a mio-specific Sender<Message> is returned.

Variants

Connect

Connect establishes a new TcpStream with a specified remote. The Sender channel part is used to communicate back with the initiator on certain socket events.

The first Sender is used to communicate back the assigned Token.

Bind

To give a tighter feedback loop, a Bind message will accept a normal Rust blocking net::TcpListener. This allows the user to more easily handle binding errors before sending it into the event loop where you need to handle any errors asynchronously.

Rpc

Initiate an Rpc request. Each request needs to know which Token the respective Connection is associated with. The Reactor also knows nothing about Thrift and simply works at the binary level.

An Rpc message is also used for replying to an RPC call.

Shutdown

Completely shutdown the Reactor and event loop. All current listeners and connections will be dropped.

Trait Implementations

Derived Implementations

impl Clone for Message

fn clone(&self) -> Message

1.0.0fn clone_from(&mut self, source: &Self)

impl Debug for Message

fn fmt(&self, __arg_0: &mut Formatter) -> Result