# Trait ethcore_io::IoHandler [−] [src]

    pub trait IoHandler<Message>: Send + Sync where Message: Send + Sync + Clone + '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>>) { ... }
    }

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

## Provided Methods

### `fn initialize(&self, _io: &IoContext<Message>)`

Initialize the handler

### `fn timeout(&self, _io: &IoContext<Message>, _timer: TimerToken)`

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

### `fn message(&self, _io: &IoContext<Message>, _message: &Message)`

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

### `fn stream_hup(&self, _io: &IoContext<Message>, _stream: StreamToken)`

Called when an IO stream gets closed

### `fn stream_readable(&self, _io: &IoContext<Message>, _stream: StreamToken)`

Called when an IO stream can be read from

### `fn stream_writable(&self, _io: &IoContext<Message>, _stream: StreamToken)`

Called when an IO stream can be written to

### `fn register_stream(&self,
_stream: StreamToken,
_reg: Token,
_event_loop: &mut EventLoop<IoManager<Message>>)`

Register a new stream with the event loop

### `fn update_stream(&self,
_stream: StreamToken,
_reg: Token,
_event_loop: &mut EventLoop<IoManager<Message>>)`

Re-register a stream with the event loop

### `fn deregister_stream(&self,
_stream: StreamToken,
_event_loop: &mut EventLoop<IoManager<Message>>)`

Deregister a stream. Called whenstream is removed from event loop

## Implementors

# 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`)