pub struct FixedLogarithmicMapping;Expand description
A zero-sized logarithmic index mapping with hardcoded 1% relative accuracy.
This mapping is functionally identical to LogarithmicMapping::new(0.01) but uses compile-time constants instead of
storing gamma and multiplier as fields. This makes the type zero-sized, saving 16 bytes per DDSketch instance.
Use this mapping when you know all your sketches will use 1% relative accuracy (the common default).
§Example
use ddsketch::canonical::mapping::FixedLogarithmicMapping;
use ddsketch::canonical::DDSketch;
use ddsketch::canonical::store::CollapsingLowestDenseStore;
// Create a sketch with the fixed mapping (saves 16 bytes vs LogarithmicMapping)
let sketch: DDSketch<FixedLogarithmicMapping, CollapsingLowestDenseStore> = DDSketch::default();Implementations§
Trait Implementations§
Source§impl Clone for FixedLogarithmicMapping
impl Clone for FixedLogarithmicMapping
Source§fn clone(&self) -> FixedLogarithmicMapping
fn clone(&self) -> FixedLogarithmicMapping
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 FixedLogarithmicMapping
impl Debug for FixedLogarithmicMapping
Source§impl Default for FixedLogarithmicMapping
impl Default for FixedLogarithmicMapping
Source§fn default() -> FixedLogarithmicMapping
fn default() -> FixedLogarithmicMapping
Returns the “default value” for a type. Read more
Source§impl Hash for FixedLogarithmicMapping
impl Hash for FixedLogarithmicMapping
Source§impl IndexMapping for FixedLogarithmicMapping
impl IndexMapping for FixedLogarithmicMapping
Source§fn index(&self, value: f64) -> i32
fn index(&self, value: f64) -> i32
Returns the index of the bin for the given positive value. Read more
Source§fn value(&self, index: i32) -> f64
fn value(&self, index: i32) -> f64
Returns the representative value for the given index. Read more
Source§fn lower_bound(&self, index: i32) -> f64
fn lower_bound(&self, index: i32) -> f64
Returns the lower bound of the bin at the given index.
Source§fn relative_accuracy(&self) -> f64
fn relative_accuracy(&self) -> f64
Returns the relative accuracy of this mapping. Read more
Source§fn min_indexable_value(&self) -> f64
fn min_indexable_value(&self) -> f64
Returns the minimum positive value that can be indexed.
Source§fn max_indexable_value(&self) -> f64
fn max_indexable_value(&self) -> f64
Returns the maximum positive value that can be indexed.
Source§fn index_offset(&self) -> f64
fn index_offset(&self) -> f64
Returns the index offset used by this mapping. Read more
Source§fn interpolation(&self) -> Interpolation
fn interpolation(&self) -> Interpolation
Returns the interpolation mode used by this mapping. Read more
Source§fn validate_proto_mapping(
&self,
proto: &ProtoIndexMapping,
) -> Result<(), ProtoConversionError>
fn validate_proto_mapping( &self, proto: &ProtoIndexMapping, ) -> Result<(), ProtoConversionError>
Validates that a protobuf
IndexMapping is compatible with this mapping. Read moreSource§impl PartialEq for FixedLogarithmicMapping
impl PartialEq for FixedLogarithmicMapping
impl Copy for FixedLogarithmicMapping
impl Eq for FixedLogarithmicMapping
impl StructuralPartialEq for FixedLogarithmicMapping
Auto Trait Implementations§
impl Freeze for FixedLogarithmicMapping
impl RefUnwindSafe for FixedLogarithmicMapping
impl Send for FixedLogarithmicMapping
impl Sync for FixedLogarithmicMapping
impl Unpin for FixedLogarithmicMapping
impl UnwindSafe for FixedLogarithmicMapping
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request