Struct bitcoins::types::txout::TxOut [−][src]
pub struct TxOut {
pub value: u64,
pub script_pubkey: ScriptPubkey,
}
Expand description
An Output. This describes a new UTXO to be created. The value is encoded as an LE u64. The script pubkey encodes the spending constraints.
TxOut::null()
and TxOut::default()
return the “null” TxOut, which has a value of
0xffff_ffff_ffff_ffff, and an empty script_pubkey
. This null output is used within legacy
sighash calculations.
Fields
value: u64
The value of the output in satoshis
script_pubkey: ScriptPubkey
The ScriptPubkey
which locks the UTXO.
Implementations
Instantiate a new TxOut.
Instantiate an OP_RETURN output with some data. Discards all but the first 75 bytes.
Inspect the TxOut’s script pubkey to determine its type.
Extract the op return payload. None if not an op return.
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 RecipientIdentifier = ScriptPubkey
type RecipientIdentifier = ScriptPubkey
The associated RecipientIdentifier
type that describes to whom the output is paid.
For Bitcoin, this is a ScriptPubkey
Read more
Auto Trait Implementations
impl RefUnwindSafe for TxOut
impl UnwindSafe for TxOut
Blanket Implementations
Mutably borrows from an owned value. Read more