pub struct FilterHash(/* private fields */);
Expand description
Filter hash, as defined in BIP-157
Implementations§
Source§impl FilterHash
impl FilterHash
Sourcepub fn from_raw_hash(inner: Hash) -> FilterHash
pub fn from_raw_hash(inner: Hash) -> FilterHash
Creates this wrapper type from the inner hash type.
Sourcepub fn to_raw_hash(self) -> Hash
pub fn to_raw_hash(self) -> Hash
Returns the inner hash (sha256, sh256d etc.).
Sourcepub fn as_raw_hash(&self) -> &Hash
pub fn as_raw_hash(&self) -> &Hash
Returns a reference to the inner hash (sha256, sh256d etc.).
Source§impl FilterHash
impl FilterHash
Sourcepub fn filter_header(
&self,
previous_filter_header: &FilterHeader,
) -> FilterHeader
pub fn filter_header( &self, previous_filter_header: &FilterHeader, ) -> FilterHeader
Computes the filter header from a filter hash and previous filter header.
Trait Implementations§
Source§impl AsRef<[u8]> for FilterHash
impl AsRef<[u8]> for FilterHash
Source§impl Borrow<[u8]> for FilterHash
impl Borrow<[u8]> for FilterHash
Source§impl Clone for FilterHash
impl Clone for FilterHash
Source§fn clone(&self) -> FilterHash
fn clone(&self) -> FilterHash
Returns a copy 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 Debug for FilterHash
impl Debug for FilterHash
Source§impl Decodable for FilterHash
impl Decodable for FilterHash
Source§impl<'de> Deserialize<'de> for FilterHash
impl<'de> Deserialize<'de> for FilterHash
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<FilterHash, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<FilterHash, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for FilterHash
impl Display for FilterHash
Source§impl Encodable for FilterHash
impl Encodable for FilterHash
Source§impl From<FilterHash> for Hash
impl From<FilterHash> for Hash
Source§fn from(hashtype: FilterHash) -> Hash
fn from(hashtype: FilterHash) -> Hash
Converts to this type from the input type.
Source§impl From<Hash> for FilterHash
impl From<Hash> for FilterHash
Source§fn from(inner: Hash) -> FilterHash
fn from(inner: Hash) -> FilterHash
Converts to this type from the input type.
Source§impl FromStr for FilterHash
impl FromStr for FilterHash
Source§impl Hash for FilterHash
impl Hash for FilterHash
Source§impl Hash for FilterHash
impl Hash for FilterHash
Source§const DISPLAY_BACKWARD: bool = true
const DISPLAY_BACKWARD: bool = true
Flag indicating whether user-visible serializations of this hash
should be backward. For some reason Satoshi decided this should be
true for
Sha256dHash
, so here we are.Source§type Engine = <Hash as Hash>::Engine
type Engine = <Hash as Hash>::Engine
A hashing engine which bytes can be serialized into. It is expected
to implement the
io::Write
trait, and to never return errors under
any conditions.Source§fn from_engine(e: Self::Engine) -> Self
fn from_engine(e: Self::Engine) -> Self
Produces a hash from the current state of a given engine.
Source§fn from_slice(sl: &[u8]) -> Result<FilterHash, FromSliceError>
fn from_slice(sl: &[u8]) -> Result<FilterHash, FromSliceError>
Copies a byte slice into a hash object.
Source§fn from_byte_array(bytes: Self::Bytes) -> Self
fn from_byte_array(bytes: Self::Bytes) -> Self
Constructs a hash from the underlying byte array.
Source§fn to_byte_array(self) -> Self::Bytes
fn to_byte_array(self) -> Self::Bytes
Returns the underlying byte array.
Source§fn as_byte_array(&self) -> &Self::Bytes
fn as_byte_array(&self) -> &Self::Bytes
Returns a reference to the underlying byte array.
Source§fn hash_byte_chunks<B, I>(byte_slices: I) -> Self
fn hash_byte_chunks<B, I>(byte_slices: I) -> Self
Hashes all the byte slices retrieved from the iterator together.
Source§impl<I: SliceIndex<[u8]>> Index<I> for FilterHash
impl<I: SliceIndex<[u8]>> Index<I> for FilterHash
Source§impl LowerHex for FilterHash
impl LowerHex for FilterHash
Source§impl Ord for FilterHash
impl Ord for FilterHash
Source§fn cmp(&self, other: &FilterHash) -> Ordering
fn cmp(&self, other: &FilterHash) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for FilterHash
impl PartialEq for FilterHash
Source§impl PartialOrd for FilterHash
impl PartialOrd for FilterHash
Source§impl SerdeHash for FilterHash
impl SerdeHash for FilterHash
Source§fn from_slice_delegated(sl: &[u8]) -> Result<Self, FromSliceError>
fn from_slice_delegated(sl: &[u8]) -> Result<Self, FromSliceError>
Helper function to turn a deserialized slice into the correct hash type.
Source§fn serialize<S>(
&self,
s: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
s: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Do serde serialization.
Source§fn deserialize<'de, D>(d: D) -> Result<Self, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<'de, D>(d: D) -> Result<Self, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Do serde deserialization.
Source§impl Serialize for FilterHash
impl Serialize for FilterHash
Source§impl UpperHex for FilterHash
impl UpperHex for FilterHash
impl Copy for FilterHash
impl Eq for FilterHash
impl StructuralPartialEq for FilterHash
Auto Trait Implementations§
impl Freeze for FilterHash
impl RefUnwindSafe for FilterHash
impl Send for FilterHash
impl Sync for FilterHash
impl Unpin for FilterHash
impl UnwindSafe for FilterHash
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