pub struct Tx {
pub version: TxVer,
pub inputs: Confined<Vec<TxIn>, 0, bc::::coding::VarIntArray::{constant#1}>,
pub outputs: Confined<Vec<TxOut>, 0, bc::::coding::VarIntArray::{constant#1}>,
pub lock_time: LockTime,
}
Fields§
§version: TxVer
§inputs: Confined<Vec<TxIn>, 0, bc::::coding::VarIntArray::{constant#1}>
§outputs: Confined<Vec<TxOut>, 0, bc::::coding::VarIntArray::{constant#1}>
§lock_time: LockTime
Implementations§
Source§impl Tx
impl Tx
pub fn inputs(&self) -> Iter<'_, TxIn>
pub fn outputs(&self) -> Iter<'_, TxOut>
pub fn is_segwit(&self) -> bool
pub fn to_unsigned_tx(&self) -> Tx
Sourcepub fn ntxid(&self) -> [u8; 32]
pub fn ntxid(&self) -> [u8; 32]
Computes a “normalized TXID” which does not include any signatures.
This gives a way to identify a transaction that is “the same” as another in the sense of having same inputs and outputs.
Sourcepub fn txid(&self) -> Txid
pub fn txid(&self) -> Txid
Computes the Txid
.
Hashes the transaction excluding the segwit data (i.e. the marker,
flag bytes, and the witness fields themselves). For non-segwit
transactions which do not have any segwit data, this will be equal
to Tx::wtxid()
.
Sourcepub fn wtxid(&self) -> Wtxid
pub fn wtxid(&self) -> Wtxid
Computes the segwit version of the transaction id.
Hashes the transaction including all segwit data (i.e. the marker,
flag bytes, and the witness fields themselves). For non-segwit
transactions which do not have any segwit data, this will be equal
to [Transaction::txid()
].
Trait Implementations§
Source§impl ConsensusDecode for Tx
impl ConsensusDecode for Tx
fn consensus_decode(reader: &mut impl Read) -> Result<Tx, ConsensusDecodeError>
fn consensus_deserialize( bytes: impl AsRef<[u8]>, ) -> Result<Self, ConsensusDecodeError>
Source§impl ConsensusEncode for Tx
impl ConsensusEncode for Tx
Source§impl From<Tx> for UnsignedTx
impl From<Tx> for UnsignedTx
Source§fn from(tx: Tx) -> UnsignedTx
fn from(tx: Tx) -> UnsignedTx
Converts to this type from the input type.
Source§impl From<UnsignedTx> for Tx
impl From<UnsignedTx> for Tx
Source§fn from(unsigned_tx: UnsignedTx) -> Tx
fn from(unsigned_tx: UnsignedTx) -> Tx
Converts to this type from the input type.
Source§impl StrictDecode for Tx
impl StrictDecode for Tx
fn strict_decode(reader: &mut impl TypedRead) -> Result<Tx, DecodeError>
fn strict_read(reader: impl ReadRaw) -> Result<Self, DecodeError>
Source§impl StrictDumb for Tx
impl StrictDumb for Tx
fn strict_dumb() -> Tx
Source§impl StrictEncode for Tx
impl StrictEncode for Tx
fn strict_encode<W>(&self, writer: W) -> Result<W, Error>where
W: TypedWrite,
fn strict_write(&self, writer: impl WriteRaw) -> Result<(), Error>
Source§impl StrictStruct for Tx
impl StrictStruct for Tx
const ALL_FIELDS: &'static [&'static str]
fn strict_check_fields()
fn strict_type_info() -> TypeInfo<Self>
Source§impl StrictType for Tx
impl StrictType for Tx
const STRICT_LIB_NAME: &'static str = LIB_NAME_BITCOIN
fn strict_name() -> Option<TypeName>
Source§impl Weight for Tx
impl Weight for Tx
fn weight_units(&self) -> WeightUnits
fn vbytes(&self) -> VBytes
impl Eq for Tx
impl StrictProduct for Tx
impl StructuralPartialEq for Tx
Auto Trait Implementations§
impl Freeze for Tx
impl RefUnwindSafe for Tx
impl Send for Tx
impl Sync for Tx
impl Unpin for Tx
impl UnwindSafe for Tx
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.