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 the null TxOut, which is used in Legacy Sighash.

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

An associated error type

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

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

How is value represented in this Output? For Bitcoin this is a u64.

The associated RecipientIdentifier type that describes to whom the output is paid. For Bitcoin, this is a ScriptPubkey Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.