Struct FilterHash
pub struct FilterHash(/* private fields */);
Expand description
Filter hash, as defined in BIP-157
Implementations§
§impl FilterHash
impl FilterHash
pub fn from_raw_hash(inner: Hash) -> FilterHash
pub fn from_raw_hash(inner: Hash) -> FilterHash
Creates this wrapper type from the inner hash type.
pub fn to_raw_hash(self) -> Hash
pub fn to_raw_hash(self) -> Hash
Returns the inner hash (sha256, sh256d etc.).
pub fn as_raw_hash(&self) -> &Hash
pub fn as_raw_hash(&self) -> &Hash
Returns a reference to the inner hash (sha256, sh256d etc.).
§impl FilterHash
impl FilterHash
pub 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§
§impl AsRef<[u8]> for FilterHash
impl AsRef<[u8]> for FilterHash
§impl AsRef<[u8; 32]> for FilterHash
impl AsRef<[u8; 32]> for FilterHash
§impl Borrow<[u8]> for FilterHash
impl Borrow<[u8]> for FilterHash
§impl Clone for FilterHash
impl Clone for FilterHash
§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 more§impl Debug for FilterHash
impl Debug for FilterHash
§impl Decodable for FilterHash
impl Decodable for FilterHash
§impl<'de> Deserialize<'de> for FilterHash
impl<'de> Deserialize<'de> for FilterHash
§fn deserialize<D>(d: D) -> Result<FilterHash, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(d: D) -> Result<FilterHash, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Display for FilterHash
impl Display for FilterHash
§impl Encodable for FilterHash
impl Encodable for FilterHash
§impl From<FilterHash> for Hash
impl From<FilterHash> for Hash
§fn from(hashtype: FilterHash) -> Hash
fn from(hashtype: FilterHash) -> Hash
Converts to this type from the input type.
§impl From<Hash> for FilterHash
impl From<Hash> for FilterHash
§fn from(inner: Hash) -> FilterHash
fn from(inner: Hash) -> FilterHash
Converts to this type from the input type.
§impl FromStr for FilterHash
impl FromStr for FilterHash
§type Err = HexToArrayError
type Err = HexToArrayError
The associated error which can be returned from parsing.
§fn from_str(s: &str) -> Result<FilterHash, <FilterHash as FromStr>::Err>
fn from_str(s: &str) -> Result<FilterHash, <FilterHash as FromStr>::Err>
Parses a string
s
to return a value of this type. Read more§impl Hash for FilterHash
impl Hash for FilterHash
§impl Hash for FilterHash
impl Hash for FilterHash
§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.§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.§fn engine() -> <FilterHash as Hash>::Engine
fn engine() -> <FilterHash as Hash>::Engine
Constructs a new engine.
§fn from_engine(e: <FilterHash as Hash>::Engine) -> FilterHash
fn from_engine(e: <FilterHash as Hash>::Engine) -> FilterHash
Produces a hash from the current state of a given engine.
§fn from_slice(sl: &[u8]) -> Result<FilterHash, FromSliceError>
fn from_slice(sl: &[u8]) -> Result<FilterHash, FromSliceError>
Copies a byte slice into a hash object.
§fn from_byte_array(bytes: <FilterHash as Hash>::Bytes) -> FilterHash
fn from_byte_array(bytes: <FilterHash as Hash>::Bytes) -> FilterHash
Constructs a hash from the underlying byte array.
§fn to_byte_array(self) -> <FilterHash as Hash>::Bytes
fn to_byte_array(self) -> <FilterHash as Hash>::Bytes
Returns the underlying byte array.
§fn as_byte_array(&self) -> &<FilterHash as Hash>::Bytes
fn as_byte_array(&self) -> &<FilterHash as Hash>::Bytes
Returns a reference to the underlying byte array.
§fn all_zeros() -> FilterHash
fn all_zeros() -> FilterHash
Returns an all zero hash. Read more
§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.
§impl<I> Index<I> for FilterHashwhere
I: SliceIndex<[u8]>,
impl<I> Index<I> for FilterHashwhere
I: SliceIndex<[u8]>,
§impl LowerHex for FilterHash
impl LowerHex for FilterHash
§impl Ord for FilterHash
impl Ord for FilterHash
§impl PartialEq for FilterHash
impl PartialEq for FilterHash
§impl PartialOrd for FilterHash
impl PartialOrd for FilterHash
§impl SerdeHash for FilterHash
impl SerdeHash for FilterHash
§fn from_slice_delegated(sl: &[u8]) -> Result<FilterHash, FromSliceError>
fn from_slice_delegated(sl: &[u8]) -> Result<FilterHash, FromSliceError>
Helper function to turn a deserialized slice into the correct hash type.
§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.
§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.
§impl Serialize for FilterHash
impl Serialize for FilterHash
§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,
Serialize this value into the given Serde serializer. Read more
§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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more