Enum spl_token_2022::extension::ExtensionType
source · [−]#[repr(u16)]
pub enum ExtensionType {
Uninitialized,
TransferFeeConfig,
TransferFeeAmount,
MintCloseAuthority,
ConfidentialTransferMint,
ConfidentialTransferAccount,
DefaultAccountState,
ImmutableOwner,
MemoTransfer,
}
Expand description
Extensions that can be applied to mints or accounts. Mint extensions must only be applied to mint accounts, and account extensions must only be applied to token holding accounts.
Variants
Uninitialized
Used as padding if the account size would otherwise be 355, same as a multisig
TransferFeeConfig
Includes transfer fee rate info and accompanying authorities to withdraw and set the fee
TransferFeeAmount
Includes withheld transfer fees
MintCloseAuthority
Includes an optional mint close authority
ConfidentialTransferMint
Auditor configuration for confidential transfers
ConfidentialTransferAccount
State for confidential transfers
DefaultAccountState
Specifies the default Account::state for new Accounts
ImmutableOwner
Indicates that the Account owner authority cannot be changed
MemoTransfer
Require inbound transfers to have memo
Implementations
sourceimpl ExtensionType
impl ExtensionType
sourcepub fn get_type_len(&self) -> usize
pub fn get_type_len(&self) -> usize
Get the data length of the type associated with the enum
sourcepub fn get_account_len<S: BaseState>(extension_types: &[Self]) -> usize
pub fn get_account_len<S: BaseState>(extension_types: &[Self]) -> usize
Get the required account data length for the given ExtensionTypes
sourcepub fn get_account_type(&self) -> AccountType
pub fn get_account_type(&self) -> AccountType
Get the associated account type
sourcepub fn get_required_init_account_extensions(
mint_extension_types: &[Self]
) -> Vec<Self>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn get_required_init_account_extensions(
mint_extension_types: &[Self]
) -> Vec<Self>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Based on a set of AccountType::Mint ExtensionTypes, get the list of AccountType::Account ExtensionTypes required on InitializeAccount
Trait Implementations
sourceimpl Clone for ExtensionType
impl Clone for ExtensionType
sourcefn clone(&self) -> ExtensionType
fn clone(&self) -> ExtensionType
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ExtensionType
impl Debug for ExtensionType
sourceimpl From<ExtensionType> for u16
impl From<ExtensionType> for u16
sourcefn from(enum_value: ExtensionType) -> Self
fn from(enum_value: ExtensionType) -> Self
Converts to this type from the input type.
sourceimpl From<ExtensionType> for [u8; 2]
impl From<ExtensionType> for [u8; 2]
sourcefn from(a: ExtensionType) -> Self
fn from(a: ExtensionType) -> Self
Converts to this type from the input type.
sourceimpl PartialEq<ExtensionType> for ExtensionType
impl PartialEq<ExtensionType> for ExtensionType
sourceimpl TryFrom<u16> for ExtensionType
impl TryFrom<u16> for ExtensionType
type Error = TryFromPrimitiveError<ExtensionType>
type Error = TryFromPrimitiveError<ExtensionType>
The type returned in the event of a conversion error.
sourcefn try_from(number: u16) -> Result<Self, TryFromPrimitiveError<Self>>
fn try_from(number: u16) -> Result<Self, TryFromPrimitiveError<Self>>
Performs the conversion.
sourceimpl TryFromPrimitive for ExtensionType
impl TryFromPrimitive for ExtensionType
type Primitive = u16
const NAME: &'static str = "ExtensionType"
fn try_from_primitive(
number: Self::Primitive
) -> Result<Self, TryFromPrimitiveError<Self>>
impl Copy for ExtensionType
impl StructuralPartialEq for ExtensionType
Auto Trait Implementations
impl RefUnwindSafe for ExtensionType
impl Send for ExtensionType
impl Sync for ExtensionType
impl Unpin for ExtensionType
impl UnwindSafe for ExtensionType
Blanket Implementations
impl<T> AbiExample for T
impl<T> AbiExample for T
default fn example() -> T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more