Struct vapcore_io::IoContext[][src]

pub struct IoContext<Message> where
    Message: Send + Sync + 'static, 
{ /* fields omitted */ }

IO access point. This is passed to all IO handlers and provides an interface to the IO subsystem.

Implementations

impl<Message> IoContext<Message> where
    Message: Send + Sync + 'static, 
[src]

pub fn register_timer(
    &self,
    token: TimerToken,
    delay: Duration
) -> Result<(), IoError>
[src]

Register a new recurring IO timer. ‘IoHandler::timeout’ will be called with the token.

pub fn register_timer_once(
    &self,
    token: TimerToken,
    delay: Duration
) -> Result<(), IoError>
[src]

Register a new IO timer once. ‘IoHandler::timeout’ will be called with the token.

pub fn clear_timer(&self, token: TimerToken) -> Result<(), IoError>[src]

Delete a timer.

pub fn message(&self, message: Message) -> Result<(), IoError>[src]

Broadcast a message to other IO clients

pub fn channel(&self) -> IoChannel<Message>[src]

Get message channel

pub fn unregister_handler(&self) -> Result<(), IoError>[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.