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<TimeoutTimerError>;
    fn clear_timeout(&mut self, token: Timeout) -> bool;
    fn notifier(&self) -> Notifier;
    fn now(&self) -> Time;

    fn estimate_system_time(&self, time: Time) -> SystemTime { ... }
}

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

Add timeout

This method is deprecated use return value of your state machine's action to set a timeout

Clear timeout

This method is deprecated (with timeout_ms) use return value of your state machine's action to change a timeout

Returns an object that can be used to wake up the enclosed state machine

Time of the current loop iteration

This is a time that needs to be used for timeouts. It's cheap to use

Provided Methods

Returns the SystemTime that corresponds to the Time in this loop

Note: this is an estimate, because we use monotonic time under the hood, but SystemTime is a subject for adjustments of the system clock.

I.e. it is fine to use this time to present it to the user, but it's wrong to rely on it in code.

Implementors