Trait rotor::GenericScope
[−]
[src]
pub trait GenericScope { fn register(&mut self, io: &Evented, interest: EventSet, opt: PollOpt) -> Result<()>; fn reregister(&mut self, io: &Evented, interest: EventSet, opt: PollOpt) -> Result<()>; fn deregister(&mut self, io: &Evented) -> Result<()>; fn timeout_ms(&mut self, delay: u64) -> Result<Timeout, TimerError>; fn clear_timeout(&mut self, token: Timeout) -> bool; fn notifier(&mut self) -> Notifier; fn now(&self) -> Time; }
A common part of Scope
and EarlyScope
For most cases Scope
scope should be used directly. The trait is here
so you can create a constructor for state machine that is generic over
type of scope used.
Required Methods
fn register(&mut self, io: &Evented, interest: EventSet, opt: PollOpt) -> Result<()>
fn reregister(&mut self, io: &Evented, interest: EventSet, opt: PollOpt) -> Result<()>
fn deregister(&mut self, io: &Evented) -> Result<()>
fn timeout_ms(&mut self, delay: u64) -> Result<Timeout, TimerError>
Add timeout
This method is deprecated use return value of your state machine's action to set a timeout
fn clear_timeout(&mut self, token: Timeout) -> bool
Clear timeout
This method is deprecated (with timeout_ms) use return value of your state machine's action to change a timeout
fn notifier(&mut self) -> Notifier
fn now(&self) -> Time
Time of the current loop iteration
This is a time that needs to be used for timeouts. It's cheap to use
Implementors
impl<'a, C: Sized + 'a> GenericScope for Scope<'a, C>
impl<'a> GenericScope for EarlyScope<'a>