[][src]Struct suspend_core::listen::Listener

pub struct Listener { /* fields omitted */ }

A structure providing thread parking and notification operations.

Implementations

impl Listener[src]

pub fn new() -> Self[src]

Create a new Listener instance.

pub fn lock(&self) -> Result<ListenerGuard<'_>, LockError>[src]

Create a ListenerGuard from a reference to the Listener. This will fail with LockError::Contended if the Listener has already been locked.

pub fn lock_mut(&mut self) -> ListenerGuard<'_>[src]

Create a ListenerGuard from a mutable reference to the Listener. This is more efficient than Listener::lock() because the type system ensures that no other references are in use.

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

Notify the Listener instance. This method returns true if the state was not already set to notified.

pub fn notifier(&self) -> Notifier[src]

Create a new Notifier instance associated with this Listener.

pub fn waker(&self) -> Waker[src]

Create a new Waker instance associated with this Listener.

Trait Implementations

impl Debug for Listener[src]

impl Drop for Listener[src]

Auto Trait Implementations

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> Instrument for T[src]

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

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.