pub struct LinearEstimator {
pub name: String,
pub bytes_per_element: usize,
pub fixed_overhead: usize,
pub auxiliary_per_element: usize,
}Expand description
A linear memory estimator (bytes_per_element * count + overhead).
Fields§
§name: StringName of this estimator.
bytes_per_element: usizeBytes per element.
fixed_overhead: usizeFixed overhead bytes.
auxiliary_per_element: usizeAuxiliary bytes per element.
Implementations§
Source§impl LinearEstimator
impl LinearEstimator
Sourcepub fn new(name: impl Into<String>, bytes_per_element: usize) -> Self
pub fn new(name: impl Into<String>, bytes_per_element: usize) -> Self
Creates a new linear estimator.
Sourcepub fn with_overhead(self, bytes: usize) -> Self
pub fn with_overhead(self, bytes: usize) -> Self
Builder method to set fixed overhead.
Sourcepub fn with_auxiliary(self, bytes_per_element: usize) -> Self
pub fn with_auxiliary(self, bytes_per_element: usize) -> Self
Builder method to set auxiliary bytes per element.
Trait Implementations§
Source§impl Clone for LinearEstimator
impl Clone for LinearEstimator
Source§fn clone(&self) -> LinearEstimator
fn clone(&self) -> LinearEstimator
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LinearEstimator
impl Debug for LinearEstimator
Source§impl MemoryEstimator for LinearEstimator
impl MemoryEstimator for LinearEstimator
Source§fn estimate(&self) -> MemoryEstimate
fn estimate(&self) -> MemoryEstimate
Returns an estimate of memory required.
Source§fn estimate_for(&self, element_count: usize) -> MemoryEstimate
fn estimate_for(&self, element_count: usize) -> MemoryEstimate
Returns an estimate scaled for a specific element count.
Auto Trait Implementations§
impl Freeze for LinearEstimator
impl RefUnwindSafe for LinearEstimator
impl Send for LinearEstimator
impl Sync for LinearEstimator
impl Unpin for LinearEstimator
impl UnwindSafe for LinearEstimator
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.