[][src]Struct elements::Transaction

pub struct Transaction {
    pub version: u32,
    pub lock_time: u32,
    pub input: Vec<TxIn>,
    pub output: Vec<TxOut>,
}

Elements transaction

Fields

version: u32

Transaction version field (should always be 2)

lock_time: u32

Transaction locktime

input: Vec<TxIn>

Vector of inputs

output: Vec<TxOut>

Vector of outputs

Methods

impl Transaction[src]

pub fn is_coinbase(&self) -> bool[src]

Whether the transaction is a coinbase tx

pub fn has_witness(&self) -> bool[src]

Determines whether a transaction has any non-null witnesses

pub fn get_weight(&self) -> usize[src]

Get the "weight" of this transaction; roughly equivalent to BIP141, in that witness data is counted as 1 while non-witness data is counted as 4.

pub fn txid(&self) -> Txid[src]

The txid of the transaction. To get its hash, use BitcoinHash::bitcoin_hash().

Trait Implementations

impl BitcoinHash<Txid> for Transaction[src]

fn bitcoin_hash(&self) -> Txid[src]

To get a transaction's txid, which is usually what you want, use the txid method.

impl Clone for Transaction[src]

impl Debug for Transaction[src]

impl Decodable for Transaction[src]

impl Default for Transaction[src]

impl Encodable for Transaction[src]

impl Eq for Transaction[src]

impl Hash for Transaction[src]

impl PartialEq<Transaction> for Transaction[src]

impl StructuralEq for Transaction[src]

impl StructuralPartialEq for Transaction[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.