pub trait IoHandler<Message>: Send + Sync{
// Provided methods
fn initialize(&self, _io: &IoContext<Message>) { ... }
fn timeout(&self, _io: &IoContext<Message>, _timer: TimerToken) { ... }
fn message(&self, _io: &IoContext<Message>, _message: &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§
Sourcefn initialize(&self, _io: &IoContext<Message>)
fn initialize(&self, _io: &IoContext<Message>)
Initialize the handler
Sourcefn timeout(&self, _io: &IoContext<Message>, _timer: TimerToken)
fn timeout(&self, _io: &IoContext<Message>, _timer: TimerToken)
Timer function called after a timeout created with HandlerIo::timeout
.