Struct bitcoins::types::txin::TxInput [−][src]
pub struct TxInput<M> where
M: MarkedDigestOutput, {
pub outpoint: Outpoint<M>,
pub script_sig: ScriptSig,
pub sequence: u32,
}
Expand description
An TxInput. This data structure contains an outpoint referencing an existing UTXO, a
script_sig
, which will contain spend authorization information (when spending a Legacy or
Witness-via-P2SH prevout), and a sequence number which may encode relative locktim semantics
in version 2+ transactions.
The script_sig
is always empty (a null prefixed vector), for native Witness prevouts.
Sequence encoding is complex and the field also encodes information about locktimes and RBF. See my blogpost on the subject.
Fields
outpoint: Outpoint<M>
The Outpoint identifying the UTXO being spent.
script_sig: ScriptSig
For Legacy transactions, the authorization information necessary to spend the UTXO.
sequence: u32
The nSequence field
Implementations
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
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
type TxoIdentifier = Outpoint<M>
type TxoIdentifier = Outpoint<M>
An input must define what type contains the TXO ID it is spending.
Auto Trait Implementations
impl<M> RefUnwindSafe for TxInput<M> where
M: RefUnwindSafe,
impl<M> UnwindSafe for TxInput<M> where
M: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more