pub trait SizeBytes {
// Required method
fn heap_size_bytes(&self) -> u64;
// Provided methods
fn total_size_bytes(&self) -> u64 { ... }
fn stack_size_bytes(&self) -> u64 { ... }
fn is_pod() -> bool { ... }
}Expand description
Approximations of stack and heap size for both internal and external types.
Motly used for statistics and triggering events such as garbage collection.
Required Methods§
sourcefn heap_size_bytes(&self) -> u64
fn heap_size_bytes(&self) -> u64
Returns the total size of self on the heap, in bytes.
Provided Methods§
sourcefn total_size_bytes(&self) -> u64
fn total_size_bytes(&self) -> u64
Returns the total size of self in bytes, accounting for both stack and heap space.
sourcefn stack_size_bytes(&self) -> u64
fn stack_size_bytes(&self) -> u64
Returns the total size of self on the stack, in bytes.
Defaults to std::mem::size_of_val(self).
Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
source§impl SizeBytes for BackgroundKind
impl SizeBytes for BackgroundKind
source§impl SizeBytes for ContainerKind
impl SizeBytes for ContainerKind
source§impl SizeBytes for Background
impl SizeBytes for Background
source§impl SizeBytes for PlotLegend
impl SizeBytes for PlotLegend
source§impl SizeBytes for ScalarAxis
impl SizeBytes for ScalarAxis
source§impl SizeBytes for SpaceViewBlueprint
impl SizeBytes for SpaceViewBlueprint
source§impl SizeBytes for SpaceViewContents
impl SizeBytes for SpaceViewContents
source§impl SizeBytes for VisibleTimeRanges
impl SizeBytes for VisibleTimeRanges
source§impl SizeBytes for VisualBounds2D
impl SizeBytes for VisualBounds2D
source§impl SizeBytes for IncludedContent
impl SizeBytes for IncludedContent
source§impl SizeBytes for LockRangeDuringZoom
impl SizeBytes for LockRangeDuringZoom
source§impl SizeBytes for PanelExpanded
impl SizeBytes for PanelExpanded
source§impl SizeBytes for QueryExpression
impl SizeBytes for QueryExpression
source§impl SizeBytes for SpaceViewClass
impl SizeBytes for SpaceViewClass
source§impl SizeBytes for SpaceViewOrigin
impl SizeBytes for SpaceViewOrigin
source§impl SizeBytes for ViewerRecommendationHash
impl SizeBytes for ViewerRecommendationHash
source§impl SizeBytes for VisibleTimeRange
impl SizeBytes for VisibleTimeRange
source§impl SizeBytes for VisualBounds2D
impl SizeBytes for VisualBounds2D
source§impl SizeBytes for BarChartView
impl SizeBytes for BarChartView
source§impl SizeBytes for Spatial2DView
impl SizeBytes for Spatial2DView
source§impl SizeBytes for Spatial3DView
impl SizeBytes for Spatial3DView
source§impl SizeBytes for TensorView
impl SizeBytes for TensorView
source§impl SizeBytes for TextDocumentView
impl SizeBytes for TextDocumentView
source§impl SizeBytes for TextLogView
impl SizeBytes for TextLogView
source§impl SizeBytes for TimeSeriesView
impl SizeBytes for TimeSeriesView
source§impl SizeBytes for ContainerBlueprint
impl SizeBytes for ContainerBlueprint
source§impl SizeBytes for PanelBlueprint
impl SizeBytes for PanelBlueprint
source§impl SizeBytes for ViewportBlueprint
impl SizeBytes for ViewportBlueprint
source§impl SizeBytes for AutoLayout
impl SizeBytes for AutoLayout
source§impl SizeBytes for AutoSpaceViews
impl SizeBytes for AutoSpaceViews
source§impl SizeBytes for GridColumns
impl SizeBytes for GridColumns
source§impl SizeBytes for IncludedSpaceView
impl SizeBytes for IncludedSpaceView
source§impl SizeBytes for RootContainer
impl SizeBytes for RootContainer
source§impl SizeBytes for SpaceViewMaximized
impl SizeBytes for SpaceViewMaximized
source§impl SizeBytes for String
impl SizeBytes for String
source§fn heap_size_bytes(&self) -> u64
fn heap_size_bytes(&self) -> u64
Does not take capacity into account.
source§impl<T> SizeBytes for VecDeque<T>where
T: SizeBytes,
impl<T> SizeBytes for VecDeque<T>where
T: SizeBytes,
source§fn heap_size_bytes(&self) -> u64
fn heap_size_bytes(&self) -> u64
Does not take capacity into account.
source§impl<T> SizeBytes for Vec<T>where
T: SizeBytes,
impl<T> SizeBytes for Vec<T>where
T: SizeBytes,
source§fn heap_size_bytes(&self) -> u64
fn heap_size_bytes(&self) -> u64
Does not take capacity into account.
source§impl<T, U, V, W> SizeBytes for (T, U, V, W)
impl<T, U, V, W> SizeBytes for (T, U, V, W)
source§impl<T, const N: usize> SizeBytes for [T; N]where
T: SizeBytes,
impl<T, const N: usize> SizeBytes for [T; N]where
T: SizeBytes,
fn heap_size_bytes(&self) -> u64
source§impl<T, const N: usize> SizeBytes for SmallVec<[T; N]>where
T: SizeBytes,
impl<T, const N: usize> SizeBytes for SmallVec<[T; N]>where
T: SizeBytes,
source§fn heap_size_bytes(&self) -> u64
fn heap_size_bytes(&self) -> u64
Does not take capacity into account.