pub struct WatermarkEvent {
pub level: WatermarkLevel,
pub allocated_bytes: usize,
pub capacity_bytes: usize,
pub requested_layout: Option<NonZeroLayout>,
}Expand description
Snapshot of allocation state when a WatermarkHandler fires.
Fields§
§level: WatermarkLevelWhich threshold tripped.
allocated_bytes: usizeBytes currently held by live allocations (post-update for the call that triggered this event).
capacity_bytes: usizeCapacity reported by the inner allocator at this moment.
requested_layout: Option<NonZeroLayout>The layout that triggered the event, when relevant. Some on
on_oom; None on on_warn / on_critical.
Trait Implementations§
Source§impl Clone for WatermarkEvent
impl Clone for WatermarkEvent
Source§fn clone(&self) -> WatermarkEvent
fn clone(&self) -> WatermarkEvent
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 moreimpl Copy for WatermarkEvent
Auto Trait Implementations§
impl Freeze for WatermarkEvent
impl RefUnwindSafe for WatermarkEvent
impl Send for WatermarkEvent
impl Sync for WatermarkEvent
impl Unpin for WatermarkEvent
impl UnsafeUnpin for WatermarkEvent
impl UnwindSafe for WatermarkEvent
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