pub struct BytesTracker(/* private fields */);Expand description
Shared counter of the memory held by buffer allocations.
An allocation attributed to a tracker charges its size, including the allocation header, until the allocation is freed or returned to the page cache. The tracker state lives while any handle or attributed allocation exists, so a handle can outlive the buffers and the buffers can outlive all handles.
Implementations§
Source§impl BytesTracker
impl BytesTracker
Sourcepub fn new() -> BytesTracker
pub fn new() -> BytesTracker
Creates a new tracker.
Sourcepub fn snapshot(&self) -> BytesTrackerSnapshot
pub fn snapshot(&self) -> BytesTrackerSnapshot
Returns the current values of the tracker.
Sourcepub fn ptr_eq(&self, other: &BytesTracker) -> bool
pub fn ptr_eq(&self, other: &BytesTracker) -> bool
Returns true if both handles refer to the same tracker.
Trait Implementations§
Source§impl Clone for BytesTracker
impl Clone for BytesTracker
Source§fn clone(&self) -> BytesTracker
fn clone(&self) -> BytesTracker
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BytesTracker
impl Debug for BytesTracker
Source§impl Default for BytesTracker
impl Default for BytesTracker
Source§fn default() -> BytesTracker
fn default() -> BytesTracker
Returns the “default value” for a type. Read more
Source§impl Drop for BytesTracker
impl Drop for BytesTracker
impl Send for BytesTracker
impl Sync for BytesTracker
Auto Trait Implementations§
impl Freeze for BytesTracker
impl RefUnwindSafe for BytesTracker
impl Unpin for BytesTracker
impl UnsafeUnpin for BytesTracker
impl UnwindSafe for BytesTracker
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