pub struct AsyncCounter { /* private fields */ }Implementations§
Source§impl AsyncCounter
impl AsyncCounter
pub fn new() -> Self
pub fn register_zero_notify(&self, notify: &Arc<Notify>)
pub fn register_change_notify(&self, notify: &Arc<Notify>)
pub fn register_change_callback(&self, callback: Arc<dyn Fn() + Send + Sync>)
pub fn increment(&self)
pub fn decrement(&self)
pub fn load(&self) -> usize
pub async fn wait_zero(&self, deadline: Instant) -> bool
pub async fn wait_zero_unbounded(&self)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for AsyncCounter
impl !RefUnwindSafe for AsyncCounter
impl !UnwindSafe for AsyncCounter
impl Send for AsyncCounter
impl Sync for AsyncCounter
impl Unpin for AsyncCounter
impl UnsafeUnpin for AsyncCounter
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