[−][src]Struct suspend_core::listen::Listener
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
Auto Trait Implementations
impl RefUnwindSafe for Listener
[src]
impl !Send for Listener
[src]
impl !Sync for Listener
[src]
impl Unpin for Listener
[src]
impl UnwindSafe for Listener
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,