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§
§impl OutPoint
impl OutPoint
pub 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.
pub fn is_null(&self) -> bool
pub fn is_null(&self) -> bool
Checks if an OutPoint
is “null”.
§Examples
use bitcoin::consensus::params;
use bitcoin::constants::genesis_block;
use bitcoin::Network;
let block = genesis_block(¶ms::MAINNET);
let tx = &block.txdata[0];
// Coinbase transactions don't have any previous output.
assert!(tx.input[0].previous_output.is_null());
Trait Implementations§
§impl<'de> Deserialize<'de> for OutPoint
impl<'de> Deserialize<'de> for OutPoint
§fn deserialize<D>(
deserializer: D
) -> Result<OutPoint, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D
) -> Result<OutPoint, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Ord for OutPoint
impl Ord for OutPoint
§impl PartialOrd for OutPoint
impl PartialOrd for OutPoint
§fn partial_cmp(&self, other: &OutPoint) -> Option<Ordering>
fn partial_cmp(&self, other: &OutPoint) -> Option<Ordering>
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§impl Serialize for OutPoint
impl Serialize for OutPoint
§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more