pub struct Wtxid(/* private fields */);
Expand description
A bitcoin witness transaction ID.
Implementations§
Source§impl Wtxid
impl Wtxid
Sourcepub const fn from_byte_array(bytes: <Hash as Hash>::Bytes) -> Self
pub const fn from_byte_array(bytes: <Hash as Hash>::Bytes) -> Self
Constructs a hash from the underlying byte array.
Sourcepub fn from_slice(sl: &[u8]) -> Result<Wtxid, FromSliceError>
👎Deprecated since 0.15.0: use from_byte_array
instead
pub fn from_slice(sl: &[u8]) -> Result<Wtxid, FromSliceError>
from_byte_array
insteadCopies a byte slice into a hash object.
Sourcepub const fn to_byte_array(self) -> <Hash as Hash>::Bytes
pub const fn to_byte_array(self) -> <Hash as Hash>::Bytes
Returns the underlying byte array.
Sourcepub const fn as_byte_array(&self) -> &<Hash as Hash>::Bytes
pub const fn as_byte_array(&self) -> &<Hash as Hash>::Bytes
Returns a reference to the underlying byte array.
Source§impl Wtxid
impl Wtxid
Sourcepub const COINBASE: Self
pub const COINBASE: Self
The Wtxid
of a coinbase transaction.
This is used as the wTXID for the coinbase transaction when constructing blocks (in the witness commitment tree) since the coinbase transaction contains a commitment to all transactions’ wTXIDs but naturally cannot commit to its own.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Wtxid
impl<'de> Deserialize<'de> for Wtxid
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Wtxid, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Wtxid, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&Transaction> for Wtxid
Available on crate feature alloc
only.
impl From<&Transaction> for Wtxid
Available on crate feature
alloc
only.Source§fn from(tx: &Transaction) -> Wtxid
fn from(tx: &Transaction) -> Wtxid
Converts to this type from the input type.
Source§impl From<Transaction> for Wtxid
Available on crate feature alloc
only.
impl From<Transaction> for Wtxid
Available on crate feature
alloc
only.Source§fn from(tx: Transaction) -> Wtxid
fn from(tx: Transaction) -> Wtxid
Converts to this type from the input type.
Source§impl Hash for Wtxid
impl Hash for Wtxid
Source§const DISPLAY_BACKWARD: bool = true
const DISPLAY_BACKWARD: bool = true
Flag indicating whether user-visible serializations of this hash should be backward. Read more
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 from_slice(sl: &[u8]) -> Result<Wtxid, FromSliceError>
fn from_slice(sl: &[u8]) -> Result<Wtxid, FromSliceError>
👎Deprecated since 0.15.0: use
from_byte_array
insteadCopies a byte slice into a hash object.
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§impl Ord for Wtxid
impl Ord for Wtxid
Source§impl PartialOrd for Wtxid
impl PartialOrd for Wtxid
impl Copy for Wtxid
impl Eq for Wtxid
impl StructuralPartialEq for Wtxid
Auto Trait Implementations§
impl Freeze for Wtxid
impl RefUnwindSafe for Wtxid
impl Send for Wtxid
impl Sync for Wtxid
impl Unpin for Wtxid
impl UnwindSafe for Wtxid
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