pub struct Covenant {
    pub covenant_type: CovenantType,
    pub covenant_data: CovenantData,
}
Expand description

A Covenant is a part of a Handshake UTXO that restricts how the UTXO may be spent over the period of multiple spends. It is able to maintain data over time.

Fields

covenant_type: CovenantType

The CovenantType restricts spending to other CovenantTypes that have a defined spending path. State machines can be constructed this way that enable the auction system.

covenant_data: CovenantData

The CovenantData represents Covenant specific data that is attached to the UTXO. This data must be updated correctly as the UTXO is spent from one CovenantType to the next CovenantType.

Implementations

Returns the null Covenant.

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

Deserialize this value from the given Serde deserializer. 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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The resulting type after obtaining ownership.

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

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.