pub struct TotalSize { /* private fields */ }Expand description
Represents the total space taken up by an instance of a variable, including heap allocations
Implementations
sourceimpl TotalSize
impl TotalSize
pub const fn new(
total_bytes: usize,
excess_bytes: usize,
shared_bytes: usize,
distinct_allocations: usize
) -> Self
pub const fn zero() -> Self
pub const fn total(total: usize) -> Self
pub const fn total_bytes(&self) -> usize
pub const fn excess_bytes(&self) -> usize
pub const fn distinct_allocations(&self) -> usize
sourcepub const fn used_bytes(&self) -> usize
pub const fn used_bytes(&self) -> usize
Return the total used bytes, calculated by total_bytes - excess_bytes
Trait Implementations
sourceimpl AddAssign<TotalSize> for TotalSize
impl AddAssign<TotalSize> for TotalSize
sourcefn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the += operation. Read more
sourceimpl Ord for TotalSize
impl Ord for TotalSize
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<TotalSize> for TotalSize
impl PartialEq<TotalSize> for TotalSize
sourceimpl PartialOrd<TotalSize> for TotalSize
impl PartialOrd<TotalSize> for TotalSize
sourcefn partial_cmp(&self, other: &TotalSize) -> Option<Ordering>
fn partial_cmp(&self, other: &TotalSize) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl SizeOf for TotalSizewhere
usize: SizeOf,
impl SizeOf for TotalSizewhere
usize: SizeOf,
sourcefn size_of_children(&self, context: &mut Context)
fn size_of_children(&self, context: &mut Context)
Gets the size of all “children” owned by this value, not including the size of the value itself. Read more
sourcefn size_of_with_context(&self, context: &mut Context)
fn size_of_with_context(&self, context: &mut Context)
sourceimpl SubAssign<TotalSize> for TotalSize
impl SubAssign<TotalSize> for TotalSize
sourcefn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the -= operation. Read more
impl Copy for TotalSize
impl Eq for TotalSize
impl StructuralEq for TotalSize
impl StructuralPartialEq for TotalSize
Auto Trait Implementations
impl RefUnwindSafe for TotalSize
impl Send for TotalSize
impl Sync for TotalSize
impl Unpin for TotalSize
impl UnwindSafe for TotalSize
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more