Struct bevy_tasks::CountdownEvent
source · [−]pub struct CountdownEvent { /* private fields */ }
Expand description
A counter that starts with an initial count n
. Once it is decremented n
times, it will be
“ready”. Call listen
to get a future that can be awaited.
Implementations
sourceimpl CountdownEvent
impl CountdownEvent
sourcepub fn new(n: isize) -> Self
pub fn new(n: isize) -> Self
Creates a CountdownEvent
that must be decremented n
times for listeners to be
signalled
sourcepub fn get(&self) -> isize
pub fn get(&self) -> isize
Get the number of times decrement must be called to trigger notifying all listeners
sourcepub fn decrement(&self)
pub fn decrement(&self)
Decrement the counter by one. If this is the Nth call, trigger all listeners
Trait Implementations
sourceimpl Clone for CountdownEvent
impl Clone for CountdownEvent
sourcefn clone(&self) -> CountdownEvent
fn clone(&self) -> CountdownEvent
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl RefUnwindSafe for CountdownEvent
impl Send for CountdownEvent
impl Sync for CountdownEvent
impl Unpin for CountdownEvent
impl UnwindSafe for CountdownEvent
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more