Trait bitcoins::types::tx::BitcoinTransaction[][src]

pub trait BitcoinTransaction: Transaction<Error = TxError, TxError = TxError, TXID = TXID, TxOut = TxOut, TxIn = BitcoinTxIn, HashWriter = Hash256> {
    fn as_legacy(&self) -> &LegacyTx;
fn into_legacy(self) -> LegacyTx;
fn into_witness(self) -> WitnessTx;
fn witnesses(&self) -> &[Witness]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
; fn txout_from_outpoint(&self, outpoint: &BitcoinOutpoint) -> Option<&TxOut> { ... } }

Functions common to Bitcoin transactions. This provides a small abstraction layer over the Legacy/SegWit tx divide by implementing a small common interface between them.

Required methods

fn as_legacy(&self) -> &LegacyTx[src]

Returns a reference to the tx as a legacy tx.

fn into_legacy(self) -> LegacyTx[src]

Consume the tx and convert it to a legacy tx. Useful for when you have dyn BitcoinTransaction or impl BitcoinTransaction types, but into_witness should be preferred, as it will never drop information.

fn into_witness(self) -> WitnessTx[src]

Consume the tx and convert it to a legacy tx. Useful for when you have dyn BitcoinTransaction or impl BitcoinTransaction types.

fn witnesses(&self) -> &[Witness]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

Return a reference to a slice of witnesses. For legacy txins this will ALWAYS be length 0. For witness txns, this will ALWAYS be the same length as the input vector.

Loading content...

Provided methods

fn txout_from_outpoint(&self, outpoint: &BitcoinOutpoint) -> Option<&TxOut>[src]

Get a reference to the output by

Loading content...

Implementors

impl BitcoinTransaction for BitcoinTx[src]

impl BitcoinTransaction for LegacyTx[src]

impl BitcoinTransaction for WitnessTx[src]

Loading content...