Struct vapcore_io::IoService[][src]

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

General IO Service. Starts an event loop and dispatches IO requests. ‘Message’ is a notification message type

Implementations

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

pub fn start() -> Result<IoService<Message>, IoError>[src]

Starts IO event loop

pub fn stop(&mut self)[src]

Stops the IO service.

pub fn register_handler(
    &self,
    handler: Arc<dyn IoHandler<Message> + Send>
) -> Result<(), IoError>
[src]

Register an IO handler with the event loop.

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

Send a message over the network. Normaly HostIo::send should be used. This can be used from non-io threads.

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

Create a new message channel

Trait Implementations

impl<Message> Drop for IoService<Message> where
    Message: Send + Sync
[src]

Auto Trait Implementations

impl<Message> !RefUnwindSafe for IoService<Message>

impl<Message> Send for IoService<Message>

impl<Message> Sync for IoService<Message>

impl<Message> Unpin for IoService<Message>

impl<Message> !UnwindSafe for IoService<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.