Skip to main content

SplTokenAccount

Struct SplTokenAccount 

Source
pub struct SplTokenAccount;
Expand description

Known external SPL TokenAccount adapter.

Trait Implementations§

Source§

impl ExplainExternal for SplTokenAccount

Source§

fn explain<S: ExternalExplainSink>( account: &AccountView<'_>, sink: &mut S, ) -> ProgramResult

Emit adapter-specific explain fields.
Source§

impl ExternalZeroCopy for SplTokenAccount

Source§

const OWNER: Option<Address>

Single expected owner program, when the adapter has one.
Source§

const MIN_LEN: usize = SPL_TOKEN_ACCOUNT_LEN

Minimum account data length accepted by this adapter.
Source§

type View<'a> = SplTokenAccountView<'a>

Guard-owned zero-copy view returned by this external adapter. Read more
Source§

fn view<'a>(data: Ref<'a, [u8]>) -> Result<Self::View<'a>, ProgramError>

Build the adapter’s typed zero-copy view from an active account-data borrow. The borrow guard is consumed so the returned view can carry it.
Source§

const DISCRIMINATOR: Option<&'static [u8]> = None

Optional byte prefix/discriminator at offset 0.
Source§

fn validate(view: &AccountView<'_>) -> ProgramResult

Validate this external account. Override for multi-owner layouts, versioned dispatch, or custom invariants.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.