pub trait SizeBytes {
const IS_POD: bool = false;
// Required method
fn heap_size_bytes(&self) -> u64;
// Provided methods
fn total_size_bytes(&self) -> u64 { ... }
fn stack_size_bytes(&self) -> u64 { ... }
}Expand description
Approximations of stack and heap size for both internal and external types.
Mostly used for statistics and triggering events such as garbage collection.
Provided Associated Constants§
Required Methods§
Sourcefn heap_size_bytes(&self) -> u64
fn heap_size_bytes(&self) -> u64
Returns how many bytes self uses on the heap.
In some cases self may be just a slice of a larger buffer.
This will in that case only return the memory used by that smaller slice.
If we however are the sole owner of the memory (e.g. a Vec), then we return
the heap size of all children plus the capacity of the buffer.
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).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl SizeBytes for ActiveVisualizers
impl SizeBytes for ActiveVisualizers
Source§impl SizeBytes for AnnotationMap
impl SizeBytes for AnnotationMap
Source§impl SizeBytes for Annotations
impl SizeBytes for Annotations
Source§impl SizeBytes for ApplicationId
impl SizeBytes for ApplicationId
fn heap_size_bytes(&self) -> u64
Source§impl SizeBytes for Background
impl SizeBytes for Background
Source§impl SizeBytes for BarChartView
impl SizeBytes for BarChartView
Source§impl SizeBytes for BlueprintActivationCommand
impl SizeBytes for BlueprintActivationCommand
fn heap_size_bytes(&self) -> u64
Source§impl SizeBytes for BlueprintUndoState
impl SizeBytes for BlueprintUndoState
Source§impl SizeBytes for BoundingBox
impl SizeBytes for BoundingBox
Source§impl SizeBytes for BufferAndFormatMatch
impl SizeBytes for BufferAndFormatMatch
Source§impl SizeBytes for ChunkRequests
impl SizeBytes for ChunkRequests
Source§impl SizeBytes for ColumnDescriptor
impl SizeBytes for ColumnDescriptor
Source§impl SizeBytes for ContainerBlueprint
impl SizeBytes for ContainerBlueprint
Source§impl SizeBytes for DataSourceMessage
impl SizeBytes for DataSourceMessage
Source§impl SizeBytes for DataSourceUiCommand
impl SizeBytes for DataSourceUiCommand
fn heap_size_bytes(&self) -> u64
Source§impl SizeBytes for DataframePart
impl SizeBytes for DataframePart
fn heap_size_bytes(&self) -> u64
Source§impl SizeBytes for DataframeQuery
impl SizeBytes for DataframeQuery
Source§impl SizeBytes for DataframeView
impl SizeBytes for DataframeView
Source§impl SizeBytes for DatatypeMatch
impl SizeBytes for DatatypeMatch
Source§impl SizeBytes for DecodeError
impl SizeBytes for DecodeError
Source§impl SizeBytes for DecodedFrameContent
impl SizeBytes for DecodedFrameContent
Source§impl SizeBytes for EntityBehavior
impl SizeBytes for EntityBehavior
Source§impl SizeBytes for EyeControls3D
impl SizeBytes for EyeControls3D
Source§impl SizeBytes for ForceCenter
impl SizeBytes for ForceCenter
Source§impl SizeBytes for ForceCollisionRadius
impl SizeBytes for ForceCollisionRadius
Source§impl SizeBytes for ForceManyBody
impl SizeBytes for ForceManyBody
Source§impl SizeBytes for ForcePosition
impl SizeBytes for ForcePosition
Source§impl SizeBytes for FrameIdRegistry
impl SizeBytes for FrameIdRegistry
Source§impl SizeBytes for FunctionRegistry
impl SizeBytes for FunctionRegistry
fn heap_size_bytes(&self) -> u64
Source§impl SizeBytes for GaussianShCoefficient
impl SizeBytes for GaussianShCoefficient
Source§impl SizeBytes for GraphBackground
impl SizeBytes for GraphBackground
Source§impl SizeBytes for GraphViewState
impl SizeBytes for GraphViewState
Source§impl SizeBytes for ImageStats
impl SizeBytes for ImageStats
Source§impl SizeBytes for IndexColumnDescriptor
impl SizeBytes for IndexColumnDescriptor
Source§impl SizeBytes for IndicatedEntities
impl SizeBytes for IndicatedEntities
Source§impl SizeBytes for InstancePathHash
impl SizeBytes for InstancePathHash
Source§impl SizeBytes for IsoTransform
impl SizeBytes for IsoTransform
Source§impl SizeBytes for LineGrid3D
impl SizeBytes for LineGrid3D
Source§impl SizeBytes for MapBackground
impl SizeBytes for MapBackground
Source§impl SizeBytes for NearClipPlane
impl SizeBytes for NearClipPlane
Source§impl SizeBytes for PanelBlueprint
impl SizeBytes for PanelBlueprint
Source§impl SizeBytes for PickingLayerInstanceId
impl SizeBytes for PickingLayerInstanceId
Source§impl SizeBytes for PinholeTreeRoot
impl SizeBytes for PinholeTreeRoot
Source§impl SizeBytes for PlotBackground
impl SizeBytes for PlotBackground
Source§impl SizeBytes for PlotLegend
impl SizeBytes for PlotLegend
Source§impl SizeBytes for PointCloudBounds
impl SizeBytes for PointCloudBounds
Source§impl SizeBytes for PositionRadius
impl SizeBytes for PositionRadius
Source§impl SizeBytes for PreviewState
impl SizeBytes for PreviewState
Source§impl SizeBytes for PrioritizationState
impl SizeBytes for PrioritizationState
Source§impl SizeBytes for ProtectedChunks
impl SizeBytes for ProtectedChunks
Source§impl SizeBytes for RequestInfo
impl SizeBytes for RequestInfo
Source§impl SizeBytes for ResolvedAnnotationInfo
impl SizeBytes for ResolvedAnnotationInfo
Source§impl SizeBytes for ResolvedAnnotationInfos
impl SizeBytes for ResolvedAnnotationInfos
Source§impl SizeBytes for Rgb8Histogram
impl SizeBytes for Rgb8Histogram
Source§impl SizeBytes for Rgba32Unmul
impl SizeBytes for Rgba32Unmul
Source§impl SizeBytes for RowIdColumnDescriptor
impl SizeBytes for RowIdColumnDescriptor
Source§impl SizeBytes for RrdManifestIndex
impl SizeBytes for RrdManifestIndex
Source§impl SizeBytes for SampleMetadata
impl SizeBytes for SampleMetadata
Source§impl SizeBytes for SampleMetadataState
impl SizeBytes for SampleMetadataState
Source§impl SizeBytes for SamplesStatistics
impl SizeBytes for SamplesStatistics
fn heap_size_bytes(&self) -> u64
Source§impl SizeBytes for ScalarAxis
impl SizeBytes for ScalarAxis
Source§impl SizeBytes for SetStoreInfo
impl SizeBytes for SetStoreInfo
fn heap_size_bytes(&self) -> u64
Source§impl SizeBytes for SmartMessage
impl SizeBytes for SmartMessage
Source§impl SizeBytes for SmartMessagePayload
impl SizeBytes for SmartMessagePayload
Source§impl SizeBytes for SortOrderCache
impl SizeBytes for SortOrderCache
Source§impl SizeBytes for Spatial2DView
impl SizeBytes for Spatial2DView
Source§impl SizeBytes for Spatial3DView
impl SizeBytes for Spatial3DView
Source§impl SizeBytes for SpatialInformation
impl SizeBytes for SpatialInformation
Source§impl SizeBytes for SpatialViewState
impl SizeBytes for SpatialViewState
Source§impl SizeBytes for StateTimelineView
impl SizeBytes for StateTimelineView
Source§impl SizeBytes for StateTimelineViewState
impl SizeBytes for StateTimelineViewState
Source§impl SizeBytes for StoreSource
impl SizeBytes for StoreSource
fn heap_size_bytes(&self) -> u64
Source§impl SizeBytes for StoreSourceExtra
impl SizeBytes for StoreSourceExtra
fn heap_size_bytes(&self) -> u64
Source§impl SizeBytes for StoreVersion
impl SizeBytes for StoreVersion
fn heap_size_bytes(&self) -> u64
Source§impl SizeBytes for StoredBlobCacheKey
impl SizeBytes for StoredBlobCacheKey
Source§impl SizeBytes for TableBlueprint
impl SizeBytes for TableBlueprint
Source§impl SizeBytes for TensorScalarMapping
impl SizeBytes for TensorScalarMapping
Source§impl SizeBytes for TensorSliceSelection
impl SizeBytes for TensorSliceSelection
Source§impl SizeBytes for TensorStats
impl SizeBytes for TensorStats
Source§impl SizeBytes for TensorView
impl SizeBytes for TensorView
Source§impl SizeBytes for TensorViewFit
impl SizeBytes for TensorViewFit
Source§impl SizeBytes for TextDocumentFormat
impl SizeBytes for TextDocumentFormat
Source§impl SizeBytes for TextDocumentView
impl SizeBytes for TextDocumentView
Source§impl SizeBytes for TextLogColumns
impl SizeBytes for TextLogColumns
Source§impl SizeBytes for TextLogFormat
impl SizeBytes for TextLogFormat
Source§impl SizeBytes for TextLogRows
impl SizeBytes for TextLogRows
Source§impl SizeBytes for TextLogView
impl SizeBytes for TextLogView
Source§impl SizeBytes for TimeControl
impl SizeBytes for TimeControl
Source§impl SizeBytes for TimePanelBlueprint
impl SizeBytes for TimePanelBlueprint
Source§impl SizeBytes for TimeRangeHighlight
impl SizeBytes for TimeRangeHighlight
fn heap_size_bytes(&self) -> u64
Source§impl SizeBytes for TimeSeriesView
impl SizeBytes for TimeSeriesView
Source§impl SizeBytes for TransformForest
impl SizeBytes for TransformForest
Source§impl SizeBytes for TransformFrameIdHash
impl SizeBytes for TransformFrameIdHash
Source§impl SizeBytes for TransformResolutionCache
impl SizeBytes for TransformResolutionCache
Source§impl SizeBytes for TreeTransform
impl SizeBytes for TreeTransform
Source§impl SizeBytes for VariantName
impl SizeBytes for VariantName
Source§impl SizeBytes for VideoDataDescription
impl SizeBytes for VideoDataDescription
fn heap_size_bytes(&self) -> u64
Source§impl SizeBytes for VideoLoadError
impl SizeBytes for VideoLoadError
Source§impl SizeBytes for VideoPlayerStreamId
impl SizeBytes for VideoPlayerStreamId
Source§impl SizeBytes for VideoSampleDecoder
impl SizeBytes for VideoSampleDecoder
Source§impl SizeBytes for VideoSource
impl SizeBytes for VideoSource
Source§impl SizeBytes for ViewBlueprint
impl SizeBytes for ViewBlueprint
Source§impl SizeBytes for ViewBuilderId
impl SizeBytes for ViewBuilderId
Source§impl SizeBytes for ViewContents
impl SizeBytes for ViewContents
Source§impl SizeBytes for ViewStates
impl SizeBytes for ViewStates
Source§impl SizeBytes for ViewSystemIdentifier
impl SizeBytes for ViewSystemIdentifier
Source§impl SizeBytes for ViewerDiagnostic
impl SizeBytes for ViewerDiagnostic
Source§impl SizeBytes for ViewerReportSeverity
impl SizeBytes for ViewerReportSeverity
Source§impl SizeBytes for ViewportBlueprint
impl SizeBytes for ViewportBlueprint
Source§impl SizeBytes for VisibleTimeRanges
impl SizeBytes for VisibleTimeRanges
Source§impl SizeBytes for VisualBounds2D
impl SizeBytes for VisualBounds2D
Source§impl SizeBytes for VisualizableEntities
impl SizeBytes for VisualizableEntities
Source§impl SizeBytes for VisualizableReason
impl SizeBytes for VisualizableReason
Source§impl SizeBytes for VisualizerInstruction
impl SizeBytes for VisualizerInstruction
Source§impl SizeBytes for VisualizerReportContext
impl SizeBytes for VisualizerReportContext
Source§impl SizeBytes for VisualizerTypeReport
impl SizeBytes for VisualizerTypeReport
Source§impl SizeBytes for dyn ViewState
Bridges dyn ViewState back to SizeBytes, so containers like Box<dyn ViewState> can be sized.
impl SizeBytes for dyn ViewState
Bridges dyn ViewState back to SizeBytes, so containers like Box<dyn ViewState> can be sized.
fn heap_size_bytes(&self) -> u64
Source§impl<K, S> SizeBytes for HashSet<K, S>where
K: SizeBytes,
impl<K, S> SizeBytes for HashSet<K, S>where
K: SizeBytes,
fn heap_size_bytes(&self) -> u64
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 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.