Struct bitcoins::types::txin::Outpoint [−][src]
pub struct Outpoint<M> where
M: MarkedDigestOutput, {
pub txid: M,
pub idx: u32,
}
Expand description
An Outpoint. This is a unique identifier for a UTXO, and is composed of a transaction ID (in Bitcoin-style LE format), and the index of the output being spent within that transactions output vectour (vout).
Outpoint::null()
and Outpoint::default()
return the null Outpoint, which references a txid
of all 0, and a index 0xffff_ffff. This null outpoint is used in every coinbase transaction.
Fields
txid: M
The txid that created the UTXO being pointed to.
idx: u32
The index of that UTXO in the transaction’s output vector.
Implementations
Returns the default
, or null
Outpoint. This is used in the coinbase input.
Return the BE txid as hex, suitable for block explorers
Instantiate an outpoint from the Block Explorer (big-endian) TXID format and integer index
Trait Implementations
Returns the byte-length of the serialized data structure.
Deserializes an instance of Self
from a std::io::Read
.
The limit
argument is used only when deserializing collections, and specifies a maximum
number of instances of the underlying type to read. Read more
Serializes self
to a std::io::Write
. Following Write
trait conventions, its Ok
type must be a usize
denoting the number of bytes written. Read more
fn read_seq_from<R>(
reader: &mut R,
mode: ReadSeqMode
) -> Result<Vec<Self, Global>, Self::Error> where
R: Read,
fn read_seq_from<R>(
reader: &mut R,
mode: ReadSeqMode
) -> Result<Vec<Self, Global>, Self::Error> where
R: Read,
Read a sequence of exactly limit
objects from the reader.
Write a sequence of ByteFormat
objects to a writer. The iter
argument may be any object that implements
IntoIterator<Item = &Item>
. This means we can seamlessly use vectors,
slices, etc. Read more
Decodes a hex string to a Vec<u8>
, deserializes an instance of Self
from that vector.
Serialize self
to a base64 string, using standard RFC4648 non-url safe characters
Serializes self
to a vector, returns the hex-encoded vector
Serialize self
to a base64 string, using standard RFC4648 non-url safe characters
impl<'de, M> Deserialize<'de> for Outpoint<M> where
M: MarkedDigestOutput,
M: Deserialize<'de>,
impl<'de, M> Deserialize<'de> for Outpoint<M> where
M: MarkedDigestOutput,
M: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl<M> RefUnwindSafe for Outpoint<M> where
M: RefUnwindSafe,
impl<M> UnwindSafe for Outpoint<M> where
M: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more