pub struct Outpoint {
pub txid: Txid,
pub vout: u32,
}Expand description
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 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§
Source§impl AssignmentsFilter for OutPoint
impl AssignmentsFilter for OutPoint
Source§impl Decodable for OutPoint
impl Decodable for OutPoint
Source§impl<'de> Deserialize<'de> for OutPoint
impl<'de> Deserialize<'de> for OutPoint
Source§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
Source§impl Ord for OutPoint
impl Ord for OutPoint
Source§impl PartialOrd for OutPoint
impl PartialOrd for OutPoint
Source§impl Serialize for OutPoint
impl Serialize for OutPoint
Source§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
Source§impl StrictDecode for OutPoint
impl StrictDecode for OutPoint
fn strict_decode(reader: &mut impl TypedRead) -> Result<OutPoint, DecodeError>
fn strict_read(reader: impl ReadRaw) -> Result<Self, DecodeError>
Source§impl StrictDeserialize for OutPoint
impl StrictDeserialize for OutPoint
fn from_strict_serialized<const MAX: usize>( ast_data: Confined<Vec<u8>, 0, MAX>, ) -> Result<Self, DeserializeError>
fn strict_deserialize_from_file<const MAX: usize>( path: impl AsRef<Path>, ) -> Result<Self, DeserializeError>
Source§impl StrictDumb for OutPoint
impl StrictDumb for OutPoint
fn strict_dumb() -> OutPoint
Source§impl StrictEncode for OutPoint
impl StrictEncode for OutPoint
fn strict_encode<W>(&self, writer: W) -> Result<W, Error>where
W: TypedWrite,
fn strict_write(&self, writer: impl WriteRaw) -> Result<(), Error>
Source§impl StrictSerialize for OutPoint
impl StrictSerialize for OutPoint
fn strict_serialized_len<const MAX: usize>(&self) -> Result<usize, Error>
fn to_strict_serialized<const MAX: usize>( &self, ) -> Result<Confined<Vec<u8>, 0, MAX>, SerializeError>
fn strict_serialize_to_file<const MAX: usize>( &self, path: impl AsRef<Path>, ) -> Result<(), SerializeError>
Source§impl StrictStruct for OutPoint
impl StrictStruct for OutPoint
const ALL_FIELDS: &'static [&'static str]
fn strict_check_fields()
fn strict_type_info() -> TypeInfo<Self>
Source§impl StrictType for OutPoint
impl StrictType for OutPoint
const STRICT_LIB_NAME: &'static str = LIB_NAME_BITCOIN
fn strict_name() -> Option<TypeName>
impl Copy for OutPoint
impl Eq for OutPoint
impl StrictProduct 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.