pub struct Wtxid(/* private fields */);Expand description
A bitcoin witness transaction ID.
Implementations§
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.
§impl Wtxid
impl Wtxid
pub const fn from_byte_array(bytes: [u8; 32]) -> Self
pub const fn from_byte_array(bytes: [u8; 32]) -> Self
Constructs a new type from the underlying byte array.
pub const fn to_byte_array(self) -> [u8; 32]
pub const fn to_byte_array(self) -> [u8; 32]
Returns the underlying byte array.
pub const fn as_byte_array(&self) -> &[u8; 32]
pub const fn as_byte_array(&self) -> &[u8; 32]
Returns a reference to the underlying byte array.
Trait Implementations§
§impl<'a> Arbitrary<'a> for Wtxid
Available on crate feature arbitrary only.
impl<'a> Arbitrary<'a> for Wtxid
Available on crate feature
arbitrary only.§fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
Generate an arbitrary value of
Self from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
Generate an arbitrary value of
Self from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Get a size hint for how many bytes out of an
Unstructured this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Get a size hint for how many bytes out of an
Unstructured this type
needs to construct itself. Read more§impl<'de> Deserialize<'de> for Wtxid
impl<'de> Deserialize<'de> for Wtxid
§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) -> Self
fn from(tx: &Transaction) -> Self
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) -> Self
fn from(tx: Transaction) -> Self
Converts to this type from the input type.
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 UnsafeUnpin 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