[][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) -> Sha256dHash[src]

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

Trait Implementations

impl PartialEq<Transaction> for Transaction[src]

impl Default for Transaction[src]

impl Clone for Transaction[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Eq for Transaction[src]

impl Hash for Transaction[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Debug for Transaction[src]

impl<S: Encoder> Encodable<S> for Transaction[src]

impl<D: Decoder> Decodable<D> for Transaction[src]

impl BitcoinHash for Transaction[src]

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

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

Auto Trait Implementations

impl Send for Transaction

impl Sync for Transaction

Blanket Implementations

impl<T> From for T[src]

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

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

type Owned = T

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.