#[non_exhaustive]pub enum TokenError {
Rpc(ClientError),
MintNotFound(Pubkey),
MintDecodeFailed {
mint: Pubkey,
reason: String,
},
TokenAccountDecodeFailed {
token_account: Pubkey,
reason: String,
},
LengthMismatch {
mints: usize,
mint_accounts: usize,
},
TransferHookDetected {
mint: Pubkey,
program: Pubkey,
},
WithBalanceNotSupported(Pubkey),
IncoherentWrapStrategy,
InstructionBuild(String),
}Expand description
All errors returned by solana-token-toolkit public API.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Rpc(ClientError)
An RPC call failed.
MintNotFound(Pubkey)
A requested mint account does not exist on chain.
MintDecodeFailed
Failed to decode a mint account.
Fields
TokenAccountDecodeFailed
Failed to decode a token account (e.g. while reading wSOL balance).
Fields
LengthMismatch
assemble_token_account_state was called with mismatched slice lengths.
Fields
TransferHookDetected
reject_transfer_hook_mints found a hook on a mint.
Fields
WithBalanceNotSupported(Pubkey)
MintIntent::WithBalance was used with a non-SOL mint.
IncoherentWrapStrategy
MintIntent::WithBalance for native SOL was paired with
WrapSolStrategy::None.
InstructionBuild(String)
An spl-token-* instruction builder returned an error.
Trait Implementations§
Source§impl Debug for TokenError
impl Debug for TokenError
Source§impl Display for TokenError
impl Display for TokenError
Source§impl Error for TokenError
impl Error for TokenError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<Error> for TokenError
impl From<Error> for TokenError
Source§fn from(source: ClientError) -> Self
fn from(source: ClientError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for TokenError
impl !RefUnwindSafe for TokenError
impl Send for TokenError
impl Sync for TokenError
impl Unpin for TokenError
impl UnsafeUnpin for TokenError
impl !UnwindSafe for TokenError
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.