Struct HyperLogLog

Source
pub struct HyperLogLog<V: ?Sized> { /* private fields */ }
Expand description

Implementations§

Source§

impl<V> HyperLogLog<V>
where V: Hash + ?Sized,

Source

pub fn new(error_rate: f64) -> Self

Create an empty HyperLogLog data structure with the specified error tolerance.

Source

pub fn new_from(hll: &Self) -> Self

Create an empty HyperLogLog data structure, copying the error tolerance from hll.

Source

pub fn push(&mut self, value: &V)

“Visit” an element.

Source

pub fn len(&self) -> f64

Retrieve an estimate of the carginality of the stream.

Source

pub fn is_empty(&self) -> bool

Returns true if empty.

Source

pub fn union(&mut self, src: &Self)

Merge another HyperLogLog data structure into self.

This is the same as an HLL approximating cardinality of the union of two multisets.

Source

pub fn intersect(&mut self, src: &Self)

Intersect another HyperLogLog data structure into self.

Note: This is different to an HLL approximating cardinality of the intersection of two multisets.

Source

pub fn clear(&mut self)

Clears the HyperLogLog data structure, as if it was new.

Trait Implementations§

Source§

impl<'a, V> AddAssign<&'a HyperLogLog<V>> for HyperLogLog<V>
where V: Hash + ?Sized,

Source§

fn add_assign(&mut self, rhs: &'a Self)

Performs the += operation. Read more
Source§

impl<'a, V> AddAssign<&'a V> for HyperLogLog<V>
where V: Hash + ?Sized,

Source§

fn add_assign(&mut self, rhs: &'a V)

Performs the += operation. Read more
Source§

impl<V: ?Sized> Clone for HyperLogLog<V>

Source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<V> Debug for HyperLogLog<V>
where V: Hash + ?Sized,

Source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de, V: ?Sized> Deserialize<'de> for HyperLogLog<V>

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<V> Intersect for HyperLogLog<V>
where V: Hash + ?Sized,

Source§

fn intersect<'a>(iter: impl Iterator<Item = &'a Self>) -> Option<Self>
where Self: Sized + 'a,

Intersect.
Source§

impl<V: ?Sized> IntersectPlusUnionIsPlus for HyperLogLog<V>

Source§

const VAL: bool = true

Apply optimisation or not
Source§

impl<V> New for HyperLogLog<V>
where V: Hash + ?Sized,

Source§

type Config = f64

The type of data required to instantiate a new Self.
Source§

fn new(config: &Self::Config) -> Self

Instantiate a new Self with the given <Self as New>::Config.
Source§

impl<V: ?Sized> Serialize for HyperLogLog<V>

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<'a, V> UnionAssign<&'a HyperLogLog<V>> for HyperLogLog<V>
where V: Hash + ?Sized,

Source§

fn union_assign(&mut self, rhs: &'a Self)

Union.

Auto Trait Implementations§

§

impl<V> Freeze for HyperLogLog<V>
where V: ?Sized,

§

impl<V> RefUnwindSafe for HyperLogLog<V>
where V: ?Sized,

§

impl<V> Send for HyperLogLog<V>
where V: ?Sized,

§

impl<V> Sync for HyperLogLog<V>
where V: ?Sized,

§

impl<V> Unpin for HyperLogLog<V>
where V: ?Sized,

§

impl<V> UnwindSafe for HyperLogLog<V>
where V: ?Sized,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,