pub struct CloneCounterObserver(/* private fields */);
Expand description
An observer that can be cloned without modifying the clone counter, but can be used to inspect its state and awaited
Zero-indexed, but each CloneCounter
retrieved with
CloneCounterObserver::counter
increments the count by 1.
Awaiting a CloneCounterObserver
will be pending until all
associated CloneCounter
s have been dropped, and will resolve to
()
when the count is 0.
Implementations§
source§impl CloneCounterObserver
impl CloneCounterObserver
sourcepub fn new() -> Self
pub fn new() -> Self
returns a new observer with a zero count. use CloneCounterObserver::counter
to
sourcepub fn counter(&self) -> CloneCounter ⓘ
pub fn counter(&self) -> CloneCounter ⓘ
creates a new CloneCounter from this observer, incrementing the count
Trait Implementations§
source§impl Clone for CloneCounterObserver
impl Clone for CloneCounterObserver
source§impl Debug for CloneCounterObserver
impl Debug for CloneCounterObserver
source§impl Default for CloneCounterObserver
impl Default for CloneCounterObserver
source§impl From<CloneCounter> for CloneCounterObserver
impl From<CloneCounter> for CloneCounterObserver
source§fn from(value: CloneCounter) -> Self
fn from(value: CloneCounter) -> Self
Converts to this type from the input type.
source§impl From<CloneCounterObserver> for CloneCounter
impl From<CloneCounterObserver> for CloneCounter
source§fn from(value: CloneCounterObserver) -> Self
fn from(value: CloneCounterObserver) -> Self
Converts to this type from the input type.
source§impl IntoFuture for CloneCounterObserver
impl IntoFuture for CloneCounterObserver
§type IntoFuture = CloneCounterFuture
type IntoFuture = CloneCounterFuture
Which kind of future are we turning this into?
source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read more
Auto Trait Implementations§
impl RefUnwindSafe for CloneCounterObserver
impl Send for CloneCounterObserver
impl Sync for CloneCounterObserver
impl Unpin for CloneCounterObserver
impl UnwindSafe for CloneCounterObserver
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more