pub struct IoService<Message>{ /* private fields */ }
Expand description
General IO Service. Starts an event loop and dispatches IO requests. ‘Message’ is a notification message type
Implementations§
source§impl<Message> IoService<Message>
impl<Message> IoService<Message>
sourcepub fn start(network_poll: Arc<Poll>) -> Result<IoService<Message>, IoError>
pub fn start(network_poll: Arc<Poll>) -> Result<IoService<Message>, IoError>
Starts IO event loop
pub fn stop(&self)
pub fn start_network_poll( &self, network_poll: Arc<Poll>, handler: Arc<dyn IoHandler<Message>>, main_event_loop_channel: IoChannel<Message>, max_sessions: usize, stop_token: usize )
sourcepub fn register_handler(
&self,
handler: Arc<dyn IoHandler<Message> + Send>
) -> Result<(), IoError>
pub fn register_handler( &self, handler: Arc<dyn IoHandler<Message> + Send> ) -> Result<(), IoError>
Register an IO handler with the event loop.
sourcepub fn send_message(&self, message: Message) -> Result<(), IoError>
pub fn send_message(&self, message: Message) -> Result<(), IoError>
Send a message over the network. Normally HostIo::send
should be used.
This can be used from non-io threads.
Trait Implementations§
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§
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