Struct asyncio::IoService
[−]
[src]
pub struct IoService(_);
Methods
impl IoService
[src]
fn new() -> IoService
Returns a new IoService
.
Panics
Panics if too many open files.
Examples
use asyncio::IoService; let io = IoService::new();Run
fn dispatch<F>(&self, func: F) where F: FnOnce(&IoService) + Send + 'static
Requests a process to invoke the given handler.
fn post<F>(&self, func: F) where F: FnOnce(&IoService) + Send + 'static
Requests a process to invoke the given handler and return immediately.
fn run(&self)
fn stop(&self)
Sets a stop request and cancel all of the waiting event in an IoService
.
Examples
use asyncio::IoService; let io = IoService::new(); io.stop();Run
fn stopped(&self) -> bool
Returns true if this has been stopped.
Examples
use asyncio::IoService; let io = IoService::new(); assert_eq!(io.stopped(), false); io.stop(); assert_eq!(io.stopped(), true);Run
fn reset(&self)
Resets a stopped IoService
.
Examples
use asyncio::IoService; let io = IoService::new(); assert_eq!(io.stopped(), false); io.stop(); assert_eq!(io.stopped(), true); io.reset(); assert_eq!(io.stopped(), false);Run
fn work(io: &IoService) -> IoServiceWork
fn spawn<F>(io: &IoService, func: F) where F: FnOnce(&Coroutine) + 'static
Trait Implementations
impl Clone for IoService
[src]
fn clone(&self) -> IoService
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for IoService
[src]
impl IoObject for IoService
[src]
fn io_service(&self) -> &IoService
Returns a IoService
associated with this object.