[][src]Struct triggered::Trigger

pub struct Trigger { /* fields omitted */ }

A struct used to trigger Listeners it is paired with.

Can be cloned to create multiple instances that all trigger the same listeners.

Methods

impl Trigger[src]

pub fn trigger(&self)[src]

Trigger all Listeners paired with this trigger.

Makes all listeners currently blocked in Listener::wait return, and all that is being awaited finish.

Calling this method only does anything the first time. Any subsequent trigger call to the same instance or a clone thereof does nothing, it has already been triggered. Any listener waiting on the trigger after it has been triggered will just return instantly.

This method is safe to call from both async and sync code. It's not an async function, but it always finishes very fast.

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

Returns true if this trigger has been triggered.

Trait Implementations

impl Clone for Trigger[src]

impl Debug for Trigger[src]

impl Unpin for Trigger[src]

Auto Trait Implementations

impl !RefUnwindSafe for Trigger

impl Send for Trigger

impl Sync for Trigger

impl !UnwindSafe for Trigger

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.