pub struct BatchScope { /* private fields */ }Expand description
RAII guard that begins a batch scope.
While a BatchScope is alive, all Observable
notifications are deferred. When the outermost BatchScope drops,
all deferred notifications fire.
Nested BatchScopes are supported — only the outermost one flushes.
Implementations§
Source§impl BatchScope
impl BatchScope
Sourcepub fn new() -> Self
pub fn new() -> Self
Begin a new batch scope.
If already inside a batch, this increments the nesting depth.
Sourcepub fn pending_count(&self) -> usize
pub fn pending_count(&self) -> usize
Number of deferred notifications queued in the current batch.
Trait Implementations§
Source§impl Debug for BatchScope
impl Debug for BatchScope
Source§impl Default for BatchScope
impl Default for BatchScope
Auto Trait Implementations§
impl Freeze for BatchScope
impl RefUnwindSafe for BatchScope
impl Send for BatchScope
impl Sync for BatchScope
impl Unpin for BatchScope
impl UnsafeUnpin for BatchScope
impl UnwindSafe for BatchScope
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