pub struct OutPoint {
pub txid: Txid,
pub vout: u32,
}Expand description
A reference to a transaction output
Fields§
§txid: TxidThe referenced transaction’s txid
vout: u32The 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 monacoin::blockdata::constants::genesis_block;
use monacoin::network::constants::Network;
let block = genesis_block(Network::Monacoin);
let tx = &block.txdata[0];
// Coinbase transactions don't have any previous output.
assert_eq!(tx.input[0].previous_output.is_null(), true);Trait Implementations§
Source§impl Ord for OutPoint
impl Ord for OutPoint
Source§impl PartialOrd for OutPoint
impl PartialOrd for OutPoint
impl Copy for OutPoint
impl Eq for OutPoint
impl StructuralPartialEq for OutPoint
Auto Trait Implementations§
impl Freeze for OutPoint
impl RefUnwindSafe for OutPoint
impl Send for OutPoint
impl Sync for OutPoint
impl Unpin for OutPoint
impl UnwindSafe for OutPoint
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