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§
§impl CloneCounterObserver
impl CloneCounterObserver
pub fn new() -> CloneCounterObserver
pub fn new() -> CloneCounterObserver
returns a new observer with a zero count. use CloneCounterObserver::counter
to
pub fn counter(&self) -> CloneCounter
pub fn counter(&self) -> CloneCounter
creates a new CloneCounter from this observer, incrementing the count
Trait Implementations§
§impl Clone for CloneCounterObserver
impl Clone for CloneCounterObserver
§fn clone(&self) -> CloneCounterObserver
fn clone(&self) -> CloneCounterObserver
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl Debug for CloneCounterObserver
impl Debug for CloneCounterObserver
§impl Default for CloneCounterObserver
impl Default for CloneCounterObserver
§fn default() -> CloneCounterObserver
fn default() -> CloneCounterObserver
Returns the “default value” for a type. Read more
§impl From<CloneCounter> for CloneCounterObserver
impl From<CloneCounter> for CloneCounterObserver
§fn from(value: CloneCounter) -> CloneCounterObserver
fn from(value: CloneCounter) -> CloneCounterObserver
Converts to this type from the input type.
§impl IntoFuture for CloneCounterObserver
impl IntoFuture for CloneCounterObserver
§type IntoFuture = CloneCounterFuture
type IntoFuture = CloneCounterFuture
Which kind of future are we turning this into?
§fn into_future(self) -> <CloneCounterObserver as IntoFuture>::IntoFuture
fn into_future(self) -> <CloneCounterObserver as IntoFuture>::IntoFuture
Creates a future from a value. Read more
§impl PartialEq<usize> for CloneCounterObserver
impl PartialEq<usize> for CloneCounterObserver
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