Struct spl_token_2022::extension::StateWithExtensionsOwned
source · [−]pub struct StateWithExtensionsOwned<S: BaseState> {
pub base: S,
/* private fields */
}
Expand description
Encapsulates owned immutable base state data (mint or account) with possible extensions
Fields
base: S
Unpacked base data
Implementations
sourceimpl<S: BaseState> StateWithExtensionsOwned<S>
impl<S: BaseState> StateWithExtensionsOwned<S>
sourcepub fn unpack(input: Vec<u8>) -> Result<Self, ProgramError>
pub fn unpack(input: Vec<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<S: Debug + BaseState> Debug for StateWithExtensionsOwned<S>
impl<S: Debug + BaseState> Debug for StateWithExtensionsOwned<S>
sourceimpl<S: PartialEq + BaseState> PartialEq<StateWithExtensionsOwned<S>> for StateWithExtensionsOwned<S>
impl<S: PartialEq + BaseState> PartialEq<StateWithExtensionsOwned<S>> for StateWithExtensionsOwned<S>
sourcefn eq(&self, other: &StateWithExtensionsOwned<S>) -> bool
fn eq(&self, other: &StateWithExtensionsOwned<S>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &StateWithExtensionsOwned<S>) -> bool
fn ne(&self, other: &StateWithExtensionsOwned<S>) -> bool
This method tests for !=
.
impl<S: BaseState> StructuralPartialEq for StateWithExtensionsOwned<S>
Auto Trait Implementations
impl<S> RefUnwindSafe for StateWithExtensionsOwned<S> where
S: RefUnwindSafe,
impl<S> Send for StateWithExtensionsOwned<S> where
S: Send,
impl<S> Sync for StateWithExtensionsOwned<S> where
S: Sync,
impl<S> Unpin for StateWithExtensionsOwned<S> where
S: Unpin,
impl<S> UnwindSafe for StateWithExtensionsOwned<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