[−]Struct sbloom::Bloom
Unformatted binary data of fixed length.
Methods
impl Bloom
pub fn new() -> Bloom
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
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
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
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])
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
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
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
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]
BloomRef<'a>: From<B>,
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]
BloomRef<'a>: From<B>,
pub fn data(&self) -> &[u8; 256]
[src]
Trait Implementations
impl AsRef<[u8]> for Bloom
impl AsRef<Bloom> for Bloom
impl Default for Bloom
fn default() -> Self
impl Clone for Bloom
fn clone(&self) -> Bloom
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Ord for Bloom
fn cmp(&self, other: &Self) -> Ordering
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
fn clamp(self, min: Self, max: Self) -> Self
[src]
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
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
#[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
fn eq(&self, other: &Self) -> bool
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'a> PartialEq<BloomRef<'a>> for Bloom
[src]
fn eq(&self, other: &BloomRef<'a>) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Deref for Bloom
impl Debug for Bloom
impl Display for Bloom
impl FromStr for Bloom
type Err = FromHexError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Bloom, FromHexError>
impl<'a> BitAnd<&'a Bloom> for &'a Bloom
BitAnd
on references
type Output = Bloom
The resulting type after applying the &
operator.
fn bitand(self, rhs: Self) -> Self::Output
impl BitAnd<Bloom> for Bloom
Moving BitAnd
type Output = Bloom
The resulting type after applying the &
operator.
fn bitand(self, rhs: Self) -> Self::Output
impl<'a> BitOr<&'a Bloom> for &'a Bloom
BitOr
on references
type Output = Bloom
The resulting type after applying the |
operator.
fn bitor(self, rhs: Self) -> Self::Output
impl BitOr<Bloom> for Bloom
Moving BitOr
type Output = Bloom
The resulting type after applying the |
operator.
fn bitor(self, rhs: Self) -> Self::Output
impl<'a> BitXor<&'a Bloom> for &'a Bloom
BitXor
on references
type Output = Bloom
The resulting type after applying the ^
operator.
fn bitxor(self, rhs: Self) -> Self::Output
impl BitXor<Bloom> for Bloom
Moving BitXor
type Output = Bloom
The resulting type after applying the ^
operator.
fn bitxor(self, rhs: Self) -> Self::Output
impl DerefMut for Bloom
impl Index<usize> for Bloom
impl Index<Range<usize>> for Bloom
impl Index<RangeFull> for Bloom
impl IndexMut<usize> for Bloom
impl IndexMut<Range<usize>> for Bloom
impl IndexMut<RangeFull> for Bloom
impl Hash for Bloom
fn hash<H>(&self, state: &mut H) where
H: Hasher,
H: Hasher,
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl LowerHex for Bloom
impl HeapSizeOf for Bloom
fn heap_size_of_children(&self) -> usize
impl Rand for Bloom
impl Serialize for Bloom
[src]
impl<'de> Deserialize<'de> for Bloom
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
Auto Trait Implementations
Blanket Implementations
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,