Struct handshakes::types::txout::TxOut[][src]

pub struct TxOut {
    pub value: u64,
    pub locking_script: LockingScript,
    pub covenant: Covenant,
}
Expand description

An Output. This describes a new UTXO to be created. The value is encoded as an LE u64. The LockingScript encodes spending constraints.

TxOut::null() and TxOut::default() return the “null” TxOut, which has a value of 0x00, an empty locking_script and an empty covenant.

Fields

value: u64

The value of the output in dollarydoos.

locking_script: LockingScript

The LockingScript which locks the UTXO.

covenant: Covenant

The Covenant which locks the way the UTXO can be spent.

Implementations

Instantiate a new TxOut.

Instantiate the null TxOut, which is used SIGHASH_SINGLE

Instantiate an OP_RETURN output with some data. Discards all but the first 40 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

Converts self into a target type. Read more

Causes self to use its Binary implementation when Debug-formatted.

Causes self to use its Display implementation when Debug-formatted. Read more

Causes self to use its LowerExp implementation when Debug-formatted. Read more

Causes self to use its LowerHex implementation when Debug-formatted. Read more

Causes self to use its Octal implementation when Debug-formatted.

Causes self to use its Pointer implementation when Debug-formatted. Read more

Causes self to use its UpperExp implementation when Debug-formatted. Read more

Causes self to use its UpperHex implementation when Debug-formatted. Read more

Performs the conversion.

Performs the conversion.

Pipes a value into a function that cannot ordinarily be called in suffix position. Read more

Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more

Pipes a dereference into a function that cannot normally be called in suffix position. Read more

Pipes a mutable dereference into a function that cannot normally be called in suffix position. Read more

Pipes a reference into a function that cannot ordinarily be called in suffix position. Read more

Pipes a mutable reference into a function that cannot ordinarily be called in suffix position. Read more

Should always be Self

Provides immutable access for inspection. Read more

Calls tap in debug builds, and does nothing in release builds.

Provides mutable access for modification. Read more

Calls tap_mut in debug builds, and does nothing in release builds.

Provides immutable access to the reference for inspection.

Calls tap_ref in debug builds, and does nothing in release builds.

Provides mutable access to the reference for modification.

Calls tap_ref_mut in debug builds, and does nothing in release builds.

Provides immutable access to the borrow for inspection. Read more

Calls tap_borrow in debug builds, and does nothing in release builds.

Provides mutable access to the borrow for modification.

Calls tap_borrow_mut in debug builds, and does nothing in release builds. Read more

Immutably dereferences self for inspection.

Calls tap_deref in debug builds, and does nothing in release builds.

Mutably dereferences self for modification.

Calls tap_deref_mut in debug builds, and does nothing in release builds. Read more

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)

recently added

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

Attempts to convert self into a target type. 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.