pub struct Ntxid(/* private fields */);Expand description
A “normalized TXID”.
Computed on a transaction that has had the signatures removed.
This type is needed only for legacy (pre-Segwit or P2SH-wrapped segwit version 0)
applications. This method clears the script_sig field of each input, which in Segwit
transactions is already empty, so for Segwit transactions the ntxid will be equal to the
txid, and you should simply use the latter.
This gives a way to identify a transaction that is “the same” as another in the sense of having the same inputs and outputs.
Implementations§
§impl Ntxid
impl Ntxid
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 Ntxid
Available on crate feature arbitrary only.
impl<'a> Arbitrary<'a> for Ntxid
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 Ntxid
impl<'de> Deserialize<'de> for Ntxid
§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Ntxid, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Ntxid, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for Ntxid
impl Ord for Ntxid
Source§impl PartialOrd for Ntxid
impl PartialOrd for Ntxid
impl Copy for Ntxid
impl Eq for Ntxid
impl StructuralPartialEq for Ntxid
Auto Trait Implementations§
impl Freeze for Ntxid
impl RefUnwindSafe for Ntxid
impl Send for Ntxid
impl Sync for Ntxid
impl Unpin for Ntxid
impl UnsafeUnpin for Ntxid
impl UnwindSafe for Ntxid
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