Enum anchor_lang::error::Error
source · pub enum Error {
AnchorError(Box<AnchorError>),
ProgramError(Box<ProgramErrorWithOrigin>),
}
Variants§
AnchorError(Box<AnchorError>)
ProgramError(Box<ProgramErrorWithOrigin>)
Implementations§
source§impl Error
impl Error
pub fn log(&self)
pub fn with_account_name(self, account_name: impl ToString) -> Self
pub fn with_source(self, source: Source) -> Self
pub fn with_pubkeys(self, pubkeys: (Pubkey, Pubkey)) -> Self
pub fn with_values(self, values: (impl ToString, impl ToString)) -> Self
Trait Implementations§
source§impl Error for Error
impl Error for Error
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
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<AnchorError> for Error
impl From<AnchorError> for Error
source§fn from(ae: AnchorError) -> Self
fn from(ae: AnchorError) -> Self
Converts to this type from the input type.
source§impl From<Error> for Error
impl From<Error> for Error
source§fn from(error: BorshIoError) -> Self
fn from(error: BorshIoError) -> Self
Converts to this type from the input type.
source§impl From<Error> for ProgramError
impl From<Error> for ProgramError
source§fn from(e: Error) -> ProgramError
fn from(e: Error) -> ProgramError
Converts to this type from the input type.
source§impl From<ProgramError> for Error
impl From<ProgramError> for Error
source§fn from(program_error: ProgramError) -> Self
fn from(program_error: ProgramError) -> Self
Converts to this type from the input type.
source§impl From<ProgramErrorWithOrigin> for Error
impl From<ProgramErrorWithOrigin> for Error
source§fn from(pe: ProgramErrorWithOrigin) -> Self
fn from(pe: ProgramErrorWithOrigin) -> Self
Converts to this type from the input type.
source§impl PartialEq for Error
impl PartialEq for Error
impl Eq for Error
impl StructuralEq for Error
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
Blanket Implementations§
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more