Struct spl_token_2022::extension::StateWithExtensions
source · [−]pub struct StateWithExtensions<'data, S: BaseState> {
pub base: S,
/* private fields */
}
Expand description
Encapsulates immutable base state data (mint or account) with possible extensions
Fields
base: S
Unpacked base data
Implementations
sourceimpl<'data, S: BaseState> StateWithExtensions<'data, S>
impl<'data, S: BaseState> StateWithExtensions<'data, S>
sourcepub fn unpack(input: &'data [u8]) -> Result<Self, ProgramError>
pub fn unpack(input: &'data [u8]) -> Result<Self, ProgramError>
Unpack base state, leaving the extension data as a slice
Fails if the base state is not initialized.
sourcepub fn get_extension<V: Extension>(&self) -> Result<&V, ProgramError>
pub fn get_extension<V: Extension>(&self) -> Result<&V, ProgramError>
Unpack a portion of the TLV data as the desired type
sourcepub fn get_extension_types(&self) -> Result<Vec<ExtensionType>, ProgramError>
pub fn get_extension_types(&self) -> Result<Vec<ExtensionType>, ProgramError>
Iterates through the TLV entries, returning only the types
Trait Implementations
sourceimpl<'data, S: Debug + BaseState> Debug for StateWithExtensions<'data, S>
impl<'data, S: Debug + BaseState> Debug for StateWithExtensions<'data, S>
sourceimpl<'data, S: PartialEq + BaseState> PartialEq<StateWithExtensions<'data, S>> for StateWithExtensions<'data, S>
impl<'data, S: PartialEq + BaseState> PartialEq<StateWithExtensions<'data, S>> for StateWithExtensions<'data, S>
sourcefn eq(&self, other: &StateWithExtensions<'data, S>) -> bool
fn eq(&self, other: &StateWithExtensions<'data, S>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &StateWithExtensions<'data, S>) -> bool
fn ne(&self, other: &StateWithExtensions<'data, S>) -> bool
This method tests for !=
.
impl<'data, S: BaseState> StructuralPartialEq for StateWithExtensions<'data, S>
Auto Trait Implementations
impl<'data, S> RefUnwindSafe for StateWithExtensions<'data, S> where
S: RefUnwindSafe,
impl<'data, S> Send for StateWithExtensions<'data, S> where
S: Send,
impl<'data, S> Sync for StateWithExtensions<'data, S> where
S: Sync,
impl<'data, S> Unpin for StateWithExtensions<'data, S> where
S: Unpin,
impl<'data, S> UnwindSafe for StateWithExtensions<'data, S> where
S: UnwindSafe,
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