pub trait IoHandler<Message>: Send + Sync where
    Message: Send + Sync + 'static, 
{ fn initialize(&self, _io: &IoContext<Message>) { ... }
fn timeout(&self, _io: &IoContext<Message>, _timer: TimerToken) { ... }
fn message(&self, _io: &IoContext<Message>, _message: &Message) { ... }
fn stream_hup(&self, _io: &IoContext<Message>, _stream: StreamToken) { ... }
fn stream_readable(&self, _io: &IoContext<Message>, _stream: StreamToken) { ... }
fn stream_writable(&self, _io: &IoContext<Message>, _stream: StreamToken) { ... }
fn register_stream(
        &self,
        _stream: StreamToken,
        _reg: Token,
        _event_loop: &mut EventLoop<IoManager<Message>>
    ) { ... }
fn update_stream(
        &self,
        _stream: StreamToken,
        _reg: Token,
        _event_loop: &mut EventLoop<IoManager<Message>>
    ) { ... }
fn deregister_stream(
        &self,
        _stream: StreamToken,
        _event_loop: &mut EventLoop<IoManager<Message>>
    ) { ... } }
Expand description

Generic IO handler. All the handler function are called from within IO event loop. Message type is used as notification data

Provided methods

Initialize the handler

Timer function called after a timeout created with HandlerIo::timeout.

Called when a broadcasted message is received. The message can only be sent from a different IO handler.

Called when an IO stream gets closed

Called when an IO stream can be read from

Called when an IO stream can be written to

Register a new stream with the event loop

Re-register a stream with the event loop

Deregister a stream. Called whenstream is removed from event loop

Implementors

impl<T: NodeInfo, M: Send + Sync + 'static> IoHandler<M> for LocalDataStore<T>