Trait tokio_executor::park::Park [−][src]
pub trait Park { type Unpark: Unpark; type Error; fn unpark(&self) -> Self::Unpark; fn park(&mut self) -> Result<(), Self::Error>; fn park_timeout(&mut self, duration: Duration) -> Result<(), Self::Error>; }
Block the current thread.
See module documentation for more details.
Associated Types
Required Methods
fn unpark(&self) -> Self::Unpark
Get a new Unpark
handle associated with this Park
instance.
fn park(&mut self) -> Result<(), Self::Error>
Block the current thread unless or until the token is available.
A call to park
does not guarantee that the thread will remain blocked
forever, and callers should be prepared for this possibility. This
function may wakeup spuriously for any reason.
See module documentation for more details.
Panics
This function should not panic, but ultimiately, panics are left as
an implementation detail. Refer to the documentation for the specific
Park
implementation
fn park_timeout(&mut self, duration: Duration) -> Result<(), Self::Error>
Park the current thread for at most duration
.
This function is the same as park
but allows specifying a maximum time
to block the thread for.
Same as park
, there is no guarantee that the thread will remain
blocked for any amount of time. Spurious wakeups are permitted for any
reason.
See module documentation for more details.
Panics
This function should not panic, but ultimiately, panics are left as
an implementation detail. Refer to the documentation for the specific
Park
implementation
Implementors
impl Park for ParkThread type Unpark = UnparkThread; type Error = ParkError;