pub struct MemoryTracker { /* private fields */ }Expand description
Tracks estimated memory usage for a streaming operator.
Implementations§
Source§impl MemoryTracker
impl MemoryTracker
Sourcepub fn new(policy: MemoryPolicy) -> MemoryTracker
pub fn new(policy: MemoryPolicy) -> MemoryTracker
Create an empty tracker using policy.
Sourcepub fn used_bytes(&self) -> u64
pub fn used_bytes(&self) -> u64
Return the currently tracked byte count.
Sourcepub fn policy(&self) -> &MemoryPolicy
pub fn policy(&self) -> &MemoryPolicy
Return the memory policy used by this tracker.
Sourcepub fn over_limit(&self) -> bool
pub fn over_limit(&self) -> bool
Return whether the tracked byte count exceeds the policy limit.
Sourcepub fn add_bytes(&mut self, bytes: u64) -> Result<(), Error>
pub fn add_bytes(&mut self, bytes: u64) -> Result<(), Error>
Add a raw byte estimate and enforce the policy.
Sourcepub fn add_row<T>(&mut self, values: &[T]) -> Result<(), Error>where
T: ByteSized,
pub fn add_row<T>(&mut self, values: &[T]) -> Result<(), Error>where
T: ByteSized,
Add a row-like slice of byte-sized values.
Trait Implementations§
Source§impl Clone for MemoryTracker
impl Clone for MemoryTracker
Source§fn clone(&self) -> MemoryTracker
fn clone(&self) -> MemoryTracker
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 moreAuto Trait Implementations§
impl !RefUnwindSafe for MemoryTracker
impl !UnwindSafe for MemoryTracker
impl Freeze for MemoryTracker
impl Send for MemoryTracker
impl Sync for MemoryTracker
impl Unpin for MemoryTracker
impl UnsafeUnpin for MemoryTracker
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