pub struct IoContext<Message>{ /* private fields */ }
Expand description
IO access point. This is passed to all IO handlers and provides an interface to the IO subsystem.
Implementations§
Source§impl<Message> IoContext<Message>
impl<Message> IoContext<Message>
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 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) -> Result<(), IoError>
pub fn unregister_handler(&self) -> Result<(), IoError>
Unregister current IO handler.
Auto Trait Implementations§
impl<Message> Freeze for IoContext<Message>
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§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more