pub(crate) struct HyperLogLog<T>{
registers: [u8; 16384],
phantom: PhantomData<T>,
}Fields§
§registers: [u8; 16384]§phantom: PhantomData<T>Implementations§
Source§impl<T> HyperLogLog<T>
impl<T> HyperLogLog<T>
Sourcepub(crate) fn new_with_registers(registers: [u8; 16384]) -> Self
pub(crate) fn new_with_registers(registers: [u8; 16384]) -> Self
Creates a HyperLogLog from already populated registers note that this method should not be invoked in untrusted environment because the internal structure of registers are not examined.
Sourcefn hash_value(&self, obj: &T) -> u64
fn hash_value(&self, obj: &T) -> u64
choice of hash function: ahash is already an dependency and it fits the requirements of being a 64bit hash with reasonable performance.
Sourcefn get_histogram(&self) -> [u32; 52]
fn get_histogram(&self) -> [u32; 52]
Get the register histogram (each value in register index into the histogram; u32 is enough because we only have 2**14=16384 registers
Sourcepub fn merge(&mut self, other: &HyperLogLog<T>)
pub fn merge(&mut self, other: &HyperLogLog<T>)
Merge the other HyperLogLog into this one
Trait Implementations§
Source§impl<T> AsRef<[u8]> for HyperLogLog<T>
impl<T> AsRef<[u8]> for HyperLogLog<T>
Source§impl<T> Clone for HyperLogLog<T>
impl<T> Clone for HyperLogLog<T>
Source§fn clone(&self) -> HyperLogLog<T>
fn clone(&self) -> HyperLogLog<T>
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<T> Debug for HyperLogLog<T>
impl<T> Debug for HyperLogLog<T>
Source§impl<T> Default for HyperLogLog<T>
impl<T> Default for HyperLogLog<T>
Source§impl<'a, T> Extend<&'a T> for HyperLogLog<T>
impl<'a, T> Extend<&'a T> for HyperLogLog<T>
Source§fn extend<S: IntoIterator<Item = &'a T>>(&mut self, iter: S)
fn extend<S: IntoIterator<Item = &'a T>>(&mut self, iter: S)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<T> Extend<T> for HyperLogLog<T>where
T: Hash,
impl<T> Extend<T> for HyperLogLog<T>where
T: Hash,
Source§fn extend<S: IntoIterator<Item = T>>(&mut self, iter: S)
fn extend<S: IntoIterator<Item = T>>(&mut self, iter: S)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<T: Hash> From<&HyperLogLog<T>> for ScalarValue
impl<T: Hash> From<&HyperLogLog<T>> for ScalarValue
Source§fn from(v: &HyperLogLog<T>) -> ScalarValue
fn from(v: &HyperLogLog<T>) -> ScalarValue
Converts to this type from the input type.
Source§impl<T: Hash> TryFrom<&[u8]> for HyperLogLog<T>
impl<T: Hash> TryFrom<&[u8]> for HyperLogLog<T>
Source§type Error = DataFusionError
type Error = DataFusionError
The type returned in the event of a conversion error.
Source§impl<T: Hash> TryFrom<&ScalarValue> for HyperLogLog<T>
impl<T: Hash> TryFrom<&ScalarValue> for HyperLogLog<T>
Source§type Error = DataFusionError
type Error = DataFusionError
The type returned in the event of a conversion error.
Source§fn try_from(v: &ScalarValue) -> Result<HyperLogLog<T>>
fn try_from(v: &ScalarValue) -> Result<HyperLogLog<T>>
Performs the conversion.
Auto Trait Implementations§
impl<T> Freeze for HyperLogLog<T>where
T: ?Sized,
impl<T> RefUnwindSafe for HyperLogLog<T>where
T: RefUnwindSafe + ?Sized,
impl<T> Send for HyperLogLog<T>
impl<T> Sync for HyperLogLog<T>
impl<T> Unpin for HyperLogLog<T>
impl<T> UnwindSafe for HyperLogLog<T>where
T: UnwindSafe + ?Sized,
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self into the result. Lower case
letters are used (e.g. f9b4ca)Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self into the result. Upper case
letters are used (e.g. F9B4CA)