pub struct Point(/* private fields */);Expand description
A totally ordered value, representing a point within an exponential bucket.
Values to construct points from can be computed by the midpoint function.
This type is a plain wrapper over f64, but implements the necessary ordering traits needed to store them in BTreeMaps or HashMaps.
Implementations§
Source§impl Point
impl Point
Sourcepub fn try_from_str(s: &str) -> Result<Self, ParsePointError>
pub fn try_from_str(s: &str) -> Result<Self, ParsePointError>
Parse a Point from its textual representation.
Sourcepub const fn is_sign_positive(&self) -> bool
pub const fn is_sign_positive(&self) -> bool
Whether the sign of the midpoint is positive.
Sourcepub const fn is_sign_negative(&self) -> bool
pub const fn is_sign_negative(&self) -> bool
Whether the sign of the midpoint is negative.
Sourcepub const fn is_zero_bucket(&self) -> bool
pub const fn is_zero_bucket(&self) -> bool
Whether the midpoint is for the zero bucket.
If this method returns true, then [self.is_positive_bucket] and [self.is_negative_bucket] will both return false.
Sourcepub const fn is_positive_bucket(&self) -> bool
pub const fn is_positive_bucket(&self) -> bool
Whether the midpoint belongs to a positive bucket.
If this method returns true, then [self.is_zero_bucket] and [self.is_negative_bucket] will both return false.
Sourcepub const fn is_negative_bucket(&self) -> bool
pub const fn is_negative_bucket(&self) -> bool
Whether the midpoint belongs to a negative bucket.
If this method returns true, then [self.is_zero_bucket] and [self.is_positive_bucket] will both return false.
Sourcepub const fn is_indexable(&self) -> bool
pub const fn is_indexable(&self) -> bool
Whether the midpoint can be represented as an exponential bucket index.
A midpoint is considered indexable if:
- It is not
0or-0. - It is finite (not infinity or NaN).
Trait Implementations§
impl Copy for Point
impl Eq for Point
Source§impl Ord for Point
impl Ord for Point
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Point
impl PartialOrd for Point
Source§impl Value for Point
Available on crate feature sval only.
impl Value for Point
sval only.Source§fn stream<'sval, S: Stream<'sval> + ?Sized>(
&'sval self,
stream: &mut S,
) -> Result
fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result
Stream.