[][src]Struct parking::Unparker

pub struct Unparker { /* fields omitted */ }

Notifies a parker.

Implementations

impl Unparker[src]

pub fn unpark(&self) -> bool[src]

Notifies the associated parker.

Returns true if this call is the first to notify the parker, or false if the parker was already notified.

Examples

use std::thread;
use std::time::Duration;
use parking::Parker;

let p = Parker::new();
let u = p.unparker();

thread::spawn(move || {
    thread::sleep(Duration::from_millis(500));
    u.unpark();
});

// Wakes up when `u.unpark()` notifies and then goes back into unnotified state.
p.park();

Trait Implementations

impl Clone for Unparker[src]

impl Debug for Unparker[src]

Auto Trait Implementations

impl !RefUnwindSafe for Unparker

impl Send for Unparker

impl Sync for Unparker

impl Unpin for Unparker

impl !UnwindSafe for Unparker

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.