Struct ethcore_io::IoService
source · [−]Expand description
General IO Service. Starts an event loop and dispatches IO requests. ‘Message’ is a notification message type
Implementations
sourceimpl<Message> IoService<Message> where
Message: Send + Sync + 'static,
impl<Message> IoService<Message> where
Message: Send + Sync + 'static,
sourcepub fn start(symbolic_name: &'static str) -> Result<IoService<Message>, IoError>
pub fn start(symbolic_name: &'static str) -> Result<IoService<Message>, IoError>
Starts IO event loop
pub fn stop(&mut self)
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>
Regiter 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. Normaly 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more