pub struct StateWithExtensionsMut<'data, S: BaseState> {
    pub base: S,
    /* private fields */
}
Expand description

Encapsulates mutable base state data (mint or account) with possible extensions

Fields

base: S

Unpacked base data

Implementations

Unpack base state, leaving the extension data as a mutable slice

Fails if the base state is not initialized.

Unpack an uninitialized base state, leaving the extension data as a mutable slice

Fails if the base state has already been initialized.

Unpack a portion of the TLV data as the desired type that allows modifying the type

Unpack a portion of the TLV data as the desired type

Packs base state data into the base data portion

Packs the default extension data into an open slot if not already found in the data buffer, otherwise overwrites the existing extension with the default state

If extension_type is an Account-associated ExtensionType that requires initialization on InitializeAccount, this method packs the default relevant Extension of an ExtensionType into an open slot if not already found in the data buffer, otherwise overwrites the existing extension with the default state. For all other ExtensionTypes, this is a no-op.

Write the account type into the buffer, done during the base state initialization Noops if there is no room for an extension in the account, needed for pure base mints / accounts.

Iterates through the TLV entries, returning only the types

Trait Implementations

Formats the value using the given formatter. Read more

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

This method tests for !=.

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 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.