# 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.

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result
+
  Collapse/expand all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)