[][src]Struct sv::util::BloomFilter

pub struct BloomFilter {
    pub filter: Vec<u8>,
    pub num_hash_funcs: usize,
    pub tweak: u32,
}

Bloom filter used by SPV nodes to limit transactions received

Fields

Filter bit field

Number of hash functions used

Random tweak to generate the hash functions

Methods

impl BloomFilter
[src]

Creates a new bloom filter

  • insert - Number of items expected to be inserted into the bloom filter
  • pr_false_pos - Desired probability of a false positive

Adds data to the bloom filter

Probabilistically returns whether the bloom filter contains the given data

There may be false positives, but there won't be false negatives.

Returns whether the BloomFilter is valid

Trait Implementations

impl Serializable<BloomFilter> for BloomFilter
[src]

impl Clone for BloomFilter
[src]

Performs copy-assignment from source. Read more

impl Eq for BloomFilter
[src]

impl Default for BloomFilter
[src]

impl PartialEq<BloomFilter> for BloomFilter
[src]

impl Debug for BloomFilter
[src]

impl Hash for BloomFilter
[src]

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

Auto Trait Implementations

impl Send for BloomFilter

impl Sync for BloomFilter

Blanket Implementations

impl<T> From for T
[src]

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

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

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

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

The type returned in the event of a conversion error.

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

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

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

The type returned in the event of a conversion error.

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

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

impl<T> Same for T

Should always be Self