Struct nexus::Reactor
[−]
[src]
pub struct Reactor<P: Protocol>(_, _);
A Reactor runs the event loop and manages sockets
Methods
impl<P: Protocol> Reactor<P>
[src]
fn add_socket(
&mut self,
socket: P::Socket,
events: EventSet
) -> Result<Token, ReactorError<P::Socket>>
&mut self,
socket: P::Socket,
events: EventSet
) -> Result<Token, ReactorError<P::Socket>>
Add socket to the Reactor.
fn add_socket_timeout(
&mut self,
socket: P::Socket,
events: EventSet,
timeout_ms: u64
) -> Result<Token, ReactorError<P::Socket>>
&mut self,
socket: P::Socket,
events: EventSet,
timeout_ms: u64
) -> Result<Token, ReactorError<P::Socket>>
Add socket to the Reactor with a timeout.
fn remove_socket(
&mut self,
token: Token
) -> Result<P::Socket, ReactorError<P::Socket>>
&mut self,
token: Token
) -> Result<P::Socket, ReactorError<P::Socket>>
Remove the socket associated to the token from the Reactor.
fn update_socket(
&mut self,
token: Token,
events: EventSet
) -> Result<(), ReactorError<P::Socket>>
&mut self,
token: Token,
events: EventSet
) -> Result<(), ReactorError<P::Socket>>
Update the socket associated to the token from the Reactor.
fn update_socket_timeout(
&mut self,
token: Token,
events: EventSet,
timeout_ms: u64
) -> Result<(), ReactorError<P::Socket>>
&mut self,
token: Token,
events: EventSet,
timeout_ms: u64
) -> Result<(), ReactorError<P::Socket>>
Update the socket associated to the token from the Reactor with a timeout.
impl<P: Protocol> Reactor<P>
[src]
fn new(proto: P) -> Result<Reactor<P>>
Create a new Reactor with the default options.
fn with_configuration(proto: P, config: ReactorConfig) -> Result<Reactor<P>>
Create a new Reactor with the specified configuration.
fn run(&mut self) -> Result<()>
Start and run the Reactor.
fn shutdown_handle(&self) -> ShutdownHandle
Handle to shutdown the Reactor.
fn spin_once(&mut self) -> Result<()>
spin_once the Reactor for a single iteration.
This is mostly used for test purposes.