Struct bitcoin::blockdata::transaction::OutPoint
source · pub struct OutPoint {
pub txid: Txid,
pub vout: u32,
}
Expand description
Fields§
§txid: Txid
The referenced transaction’s txid.
vout: u32
The index of the referenced output in its transaction’s vout.
Implementations§
source§impl OutPoint
impl OutPoint
sourcepub fn null() -> OutPoint
pub fn null() -> OutPoint
Creates a “null” OutPoint
.
This value is used for coinbase transactions because they don’t have any previous outputs.
sourcepub fn is_null(&self) -> bool
pub fn is_null(&self) -> bool
Checks if an OutPoint
is “null”.
Examples
use bitcoin::constants::genesis_block;
use bitcoin::network::constants::Network;
let block = genesis_block(Network::Bitcoin);
let tx = &block.txdata[0];
// Coinbase transactions don't have any previous output.
assert!(tx.input[0].previous_output.is_null());
Trait Implementations§
source§impl<'de> Deserialize<'de> for OutPoint
impl<'de> Deserialize<'de> for OutPoint
source§fn deserialize<D>(deserializer: D) -> Result<OutPoint, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<OutPoint, D::Error>where D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Ord for OutPoint
impl Ord for OutPoint
source§impl PartialEq<OutPoint> for OutPoint
impl PartialEq<OutPoint> for OutPoint
source§impl PartialOrd<OutPoint> for OutPoint
impl PartialOrd<OutPoint> for OutPoint
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more