pub struct Txid(/* private fields */);Expand description
A bitcoin transaction hash/transaction ID.
For compatibility with the existing Bitcoin infrastructure and historical and current
versions of the Bitcoin Core software itself, this and other sha256d::Hash types, are
serialized in reverse byte order when converted to a hex string via std::fmt::Display
trait operations.
Implementations§
Source§impl Txid
impl Txid
Sourcepub const COINBASE_PREVOUT: Self
pub const COINBASE_PREVOUT: Self
The Txid used in a coinbase prevout.
This is used as the “txid” of the dummy input of a coinbase transaction. This is not a real
TXID and should not be used in any other contexts. See OutPoint::COINBASE_PREVOUT.
§impl Txid
impl Txid
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 Txid
Available on crate feature arbitrary only.
impl<'a> Arbitrary<'a> for Txid
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 Txid
impl<'de> Deserialize<'de> for Txid
§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Txid, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Txid, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&Transaction> for Txid
Available on crate feature alloc only.
impl From<&Transaction> for Txid
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 Txid
Available on crate feature alloc only.
impl From<Transaction> for Txid
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 Txid
impl Ord for Txid
Source§impl PartialOrd for Txid
impl PartialOrd for Txid
impl Copy for Txid
impl Eq for Txid
impl StructuralPartialEq for Txid
Auto Trait Implementations§
impl Freeze for Txid
impl RefUnwindSafe for Txid
impl Send for Txid
impl Sync for Txid
impl Unpin for Txid
impl UnsafeUnpin for Txid
impl UnwindSafe for Txid
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