[−][src]Struct triggered::Trigger
A struct used to trigger Listener
s 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 Listener
s paired with this trigger.
Makes all listeners currently blocked in Listener::wait
return,
and all that is being await
ed 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
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]
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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.
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>,