pub struct BIP340Hash(/* private fields */);Expand description
BIP340 Hash
Implementations§
Source§impl BIP340Hash
impl BIP340Hash
Sourcepub fn from_raw_hash(inner: Hash<BIP340HashTag>) -> BIP340Hash
pub fn from_raw_hash(inner: Hash<BIP340HashTag>) -> BIP340Hash
Creates this wrapper type from the inner hash type.
Sourcepub fn to_raw_hash(self) -> Hash<BIP340HashTag>
pub fn to_raw_hash(self) -> Hash<BIP340HashTag>
Returns the inner hash (sha256, sh256d etc.).
Sourcepub fn as_raw_hash(&self) -> &Hash<BIP340HashTag>
pub fn as_raw_hash(&self) -> &Hash<BIP340HashTag>
Returns a reference to the inner hash (sha256, sh256d etc.).
Trait Implementations§
Source§impl AsRef<[u8]> for BIP340Hash
impl AsRef<[u8]> for BIP340Hash
Source§impl Borrow<[u8]> for BIP340Hash
impl Borrow<[u8]> for BIP340Hash
Source§impl Clone for BIP340Hash
impl Clone for BIP340Hash
Source§fn clone(&self) -> BIP340Hash
fn clone(&self) -> BIP340Hash
Returns a duplicate 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 BIP340Hash
impl Debug for BIP340Hash
Source§impl Display for BIP340Hash
impl Display for BIP340Hash
Source§impl From<BIP340Hash> for Hash<BIP340HashTag>
impl From<BIP340Hash> for Hash<BIP340HashTag>
Source§fn from(hashtype: BIP340Hash) -> Hash<BIP340HashTag>
fn from(hashtype: BIP340Hash) -> Hash<BIP340HashTag>
Converts to this type from the input type.
Source§impl From<Hash<BIP340HashTag>> for BIP340Hash
impl From<Hash<BIP340HashTag>> for BIP340Hash
Source§fn from(inner: Hash<BIP340HashTag>) -> BIP340Hash
fn from(inner: Hash<BIP340HashTag>) -> BIP340Hash
Converts to this type from the input type.
Source§impl FromStr for BIP340Hash
impl FromStr for BIP340Hash
Source§impl Hash for BIP340Hash
impl Hash for BIP340Hash
Source§impl Hash for BIP340Hash
impl Hash for BIP340Hash
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<BIP340HashTag> as Hash>::Engine
type Engine = <Hash<BIP340HashTag> 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§type Bytes = <Hash<BIP340HashTag> as Hash>::Bytes
type Bytes = <Hash<BIP340HashTag> as Hash>::Bytes
The byte array that represents the hash internally.
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<BIP340Hash, FromSliceError>
fn from_slice(sl: &[u8]) -> Result<BIP340Hash, 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 BIP340Hash
impl<I: SliceIndex<[u8]>> Index<I> for BIP340Hash
Source§impl LowerHex for BIP340Hash
impl LowerHex for BIP340Hash
Source§impl Ord for BIP340Hash
impl Ord for BIP340Hash
Source§fn cmp(&self, other: &BIP340Hash) -> Ordering
fn cmp(&self, other: &BIP340Hash) -> 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 BIP340Hash
impl PartialEq for BIP340Hash
Source§impl PartialOrd for BIP340Hash
impl PartialOrd for BIP340Hash
Source§impl UpperHex for BIP340Hash
impl UpperHex for BIP340Hash
impl Copy for BIP340Hash
impl Eq for BIP340Hash
impl StructuralPartialEq for BIP340Hash
Auto Trait Implementations§
impl Freeze for BIP340Hash
impl RefUnwindSafe for BIP340Hash
impl Send for BIP340Hash
impl Sync for BIP340Hash
impl Unpin for BIP340Hash
impl UnwindSafe for BIP340Hash
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