Struct ethcore_io::IoContext
source · [−]Expand description
IO access point. This is passed to all IO handlers and provides an interface to the IO subsystem.
Implementations
sourceimpl<Message> IoContext<Message> where
Message: Send + Sync + 'static,
impl<Message> IoContext<Message> where
Message: Send + Sync + 'static,
sourcepub fn new(channel: IoChannel<Message>, handler: usize) -> IoContext<Message>
pub 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.
sourcepub fn register_timer(
&self,
token: TimerToken,
delay: Duration
) -> Result<(), IoError>
pub fn register_timer(
&self,
token: TimerToken,
delay: Duration
) -> Result<(), IoError>
Register a new recurring IO timer. ‘IoHandler::timeout’ will be called with the token.
sourcepub fn register_timer_once(
&self,
token: TimerToken,
delay: Duration
) -> Result<(), IoError>
pub fn register_timer_once(
&self,
token: TimerToken,
delay: Duration
) -> Result<(), IoError>
Register a new IO timer once. ‘IoHandler::timeout’ will be called with the token.
sourcepub fn clear_timer(&self, token: TimerToken) -> Result<(), IoError>
pub fn clear_timer(&self, token: TimerToken) -> Result<(), IoError>
Delete a timer.
sourcepub fn register_stream(&self, token: StreamToken) -> Result<(), IoError>
pub fn register_stream(&self, token: StreamToken) -> Result<(), IoError>
Register a new IO stream.
sourcepub fn deregister_stream(&self, token: StreamToken) -> Result<(), IoError>
pub fn deregister_stream(&self, token: StreamToken) -> Result<(), IoError>
Deregister an IO stream.
sourcepub fn update_registration(&self, token: StreamToken) -> Result<(), IoError>
pub fn update_registration(&self, token: StreamToken) -> Result<(), IoError>
Reregister an IO stream.
sourcepub fn message(&self, message: Message) -> Result<(), IoError>
pub fn message(&self, message: Message) -> Result<(), IoError>
Broadcast a message to other IO clients
sourcepub fn unregister_handler(&self)
pub fn unregister_handler(&self)
Unregister current IO handler.
Auto Trait Implementations
impl<Message> !RefUnwindSafe for IoContext<Message>
impl<Message> Send for IoContext<Message>
impl<Message> Sync for IoContext<Message>
impl<Message> Unpin for IoContext<Message>
impl<Message> !UnwindSafe for IoContext<Message>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more