[]Struct sbloom::Bloom

#[repr(C)]
pub struct Bloom(pub [u8; 256]);

Unformatted binary data of fixed length.

Methods

impl Bloom

pub fn new() -> Bloom

Deprecated since 0.2.5:

use fixed_hash::zero constructor instead

Create a new, zero-initialised, instance.

pub fn zero() -> Bloom

Synonym for new(). Prefer to new as it's more readable.

pub fn len() -> usize

Deprecated since 0.2.5:

will be renamed to len_bytes to avoid confusion

Get the size of this object in bytes.

pub fn as_ptr(&self) -> *const u8

Returns a constant raw pointer to the value

pub fn as_mut_ptr(&mut self) -> *mut u8

pub fn clone_from_slice(&mut self, src: &[u8]) -> usize

Deprecated since 0.2.5:

unconventional API, replaced by assign_from_slice in version 0.3

Assign self to be of the same value as a slice of bytes of length len().

pub fn from_slice(src: &[u8]) -> Self

Deprecated since 0.2.5:

unconventional API, replaced by new_from_slice in version 0.3

Convert a slice of bytes of length len() to an instance of this type.

pub fn copy_to(&self, dest: &mut [u8])

Deprecated since 0.2.5:

use std::slice API instead

Copy the data of this object into some mutable slice of length len().

pub fn contains<'a>(&'a self, b: &'a Self) -> bool

Deprecated since 0.2.5:

will be renamed to covers in version 0.3

Returns true if all bits set in b are also set in self.

pub fn is_zero(&self) -> bool

Returns true if no bits are set.

pub fn low_u64(&self) -> u64

Deprecated since 0.2.5:

will be renamed to low_u64_be in version 0.3

Returns the lowest 8 bytes interpreted as a BigEndian integer.

pub fn random() -> Bloom

Create a new, cryptographically random, instance.

pub fn randomize(&mut self)

Assign self have a cryptographically random value.

impl Bloom

pub fn hex(&self) -> String

Deprecated:

Use LowerHex or Debug formatting instead.

Get a hex representation.

impl Bloom[src]

pub fn is_empty(&self) -> bool[src]

pub fn contains_input<'a>(&self, input: Input<'a>) -> bool[src]

pub fn contains_bloom<'a, B>(&self, bloom: B) -> bool where
    BloomRef<'a>: From<B>, 
[src]

pub fn accrue<'a>(&mut self, input: Input<'a>)[src]

pub fn accrue_bloom<'a, B>(&mut self, bloom: B) where
    BloomRef<'a>: From<B>, 
[src]

pub fn data(&self) -> &[u8; 256][src]

Trait Implementations

impl AsRef<[u8]> for Bloom

impl AsRef<Bloom> for Bloom

impl Default for Bloom

impl Clone for Bloom

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Ord for Bloom

fn max(self, other: Self) -> Self1.21.0[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self1.21.0[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

impl From<[u8; 256]> for Bloom

impl From<Bloom> for [u8; 256]

impl From<u64> for Bloom

impl<'a> From<&'a [u8]> for Bloom

impl From<&'static str> for Bloom

impl<'a> From<Input<'a>> for Bloom[src]

impl<'a> From<&'a Bloom> for BloomRef<'a>[src]

impl Eq for Bloom

impl Copy for Bloom

impl PartialOrd<Bloom> for Bloom

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl AsMut<[u8]> for Bloom

impl PartialEq<Bloom> for Bloom

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<'a> PartialEq<BloomRef<'a>> for Bloom[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl Deref for Bloom

type Target = [u8]

The resulting type after dereferencing.

impl Debug for Bloom

impl Display for Bloom

impl FromStr for Bloom

type Err = FromHexError

The associated error which can be returned from parsing.

impl<'a> BitAnd<&'a Bloom> for &'a Bloom

BitAnd on references

type Output = Bloom

The resulting type after applying the & operator.

impl BitAnd<Bloom> for Bloom

Moving BitAnd

type Output = Bloom

The resulting type after applying the & operator.

impl<'a> BitOr<&'a Bloom> for &'a Bloom

BitOr on references

type Output = Bloom

The resulting type after applying the | operator.

impl BitOr<Bloom> for Bloom

Moving BitOr

type Output = Bloom

The resulting type after applying the | operator.

impl<'a> BitXor<&'a Bloom> for &'a Bloom

BitXor on references

type Output = Bloom

The resulting type after applying the ^ operator.

impl BitXor<Bloom> for Bloom

Moving BitXor

type Output = Bloom

The resulting type after applying the ^ operator.

impl DerefMut for Bloom

impl Index<usize> for Bloom

type Output = u8

The returned type after indexing.

impl Index<Range<usize>> for Bloom

type Output = [u8]

The returned type after indexing.

impl Index<RangeFull> for Bloom

type Output = [u8]

The returned type after indexing.

impl IndexMut<usize> for Bloom

impl IndexMut<Range<usize>> for Bloom

impl IndexMut<RangeFull> for Bloom

impl Hash for Bloom

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl LowerHex for Bloom

impl HeapSizeOf for Bloom

impl Rand for Bloom

impl Serialize for Bloom[src]

impl<'de> Deserialize<'de> for Bloom[src]

Auto Trait Implementations

impl Send for Bloom

impl Sync for Bloom

Blanket Implementations

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

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