Struct ethcore_io::IoContext
[−]
[src]
pub struct IoContext<Message> where Message: Send + Clone + Sync + 'static { /* fields omitted */ }
IO access point. This is passed to all IO handlers and provides an interface to the IO subsystem.
Methods
impl<Message> IoContext<Message> where Message: Send + Clone + Sync + 'static
[src]
fn new(channel: IoChannel<Message>, handler: usize) -> IoContext<Message>
Create a new IO access point. Takes references to all the data that can be updated within the IO handler.
fn register_timer(&self, token: TimerToken, ms: u64) -> Result<(), IoError>
Register a new recurring IO timer. 'IoHandler::timeout' will be called with the token.
fn register_timer_once(&self, token: TimerToken, ms: u64) -> Result<(), IoError>
Register a new IO timer once. 'IoHandler::timeout' will be called with the token.
fn clear_timer(&self, token: TimerToken) -> Result<(), IoError>
Delete a timer.
fn register_stream(&self, token: StreamToken) -> Result<(), IoError>
Register a new IO stream.
fn deregister_stream(&self, token: StreamToken) -> Result<(), IoError>
Deregister an IO stream.
fn update_registration(&self, token: StreamToken) -> Result<(), IoError>
Reregister an IO stream.
fn message(&self, message: Message) -> Result<(), IoError>
Broadcast a message to other IO clients
fn channel(&self) -> IoChannel<Message>
Get message channel
fn unregister_handler(&self) -> Result<(), IoError>
Unregister current IO handler.