pub enum KernelError {
InvalidState(InvalidStateCode),
OpIdMismatch {
expected: u64,
actual: u64,
},
Slippage {
min: u128,
actual: u128,
},
MinWithdrawal {
amount: u128,
min: u128,
},
QueueFull {
current: u32,
max: u32,
},
NoPendingWithdrawals,
Cooldown {
requested_at: u64,
now: u64,
cooldown_ns: u64,
},
Transition(TransitionError),
NotImplemented,
Restricted(RestrictionKind),
InvalidConfig(InvalidConfigCode),
ZeroAmount,
}Expand description
Errors that can occur when applying kernel actions.
Variants§
InvalidState(InvalidStateCode)
OpIdMismatch
Slippage
MinWithdrawal
QueueFull
NoPendingWithdrawals
Cooldown
Transition(TransitionError)
NotImplemented
Restricted(RestrictionKind)
InvalidConfig(InvalidConfigCode)
ZeroAmount
Implementations§
Source§impl KernelError
impl KernelError
pub const fn diagnostic_code(&self) -> KernelDiagnosticCode
pub const fn family(&self) -> KernelErrorCode
pub const fn family_code(&self) -> u32
pub const fn detailed_code(&self) -> u32
Trait Implementations§
Source§impl Clone for KernelError
impl Clone for KernelError
Source§fn clone(&self) -> KernelError
fn clone(&self) -> KernelError
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KernelError
impl Debug for KernelError
Source§impl Display for KernelError
impl Display for KernelError
Source§impl From<&KernelError> for KernelDiagnosticCode
impl From<&KernelError> for KernelDiagnosticCode
Source§fn from(error: &KernelError) -> Self
fn from(error: &KernelError) -> Self
Converts to this type from the input type.
Source§impl From<InvalidConfigCode> for KernelError
impl From<InvalidConfigCode> for KernelError
Source§fn from(code: InvalidConfigCode) -> Self
fn from(code: InvalidConfigCode) -> Self
Converts to this type from the input type.
Source§impl From<InvalidStateCode> for KernelError
impl From<InvalidStateCode> for KernelError
Source§fn from(code: InvalidStateCode) -> Self
fn from(code: InvalidStateCode) -> Self
Converts to this type from the input type.
Source§impl From<TransitionError> for KernelError
impl From<TransitionError> for KernelError
Source§fn from(error: TransitionError) -> Self
fn from(error: TransitionError) -> Self
Converts to this type from the input type.
Source§impl HasKernelDiagnosticCode for &KernelError
impl HasKernelDiagnosticCode for &KernelError
fn diagnostic_code(&self) -> KernelDiagnosticCode
Source§impl HasKernelDiagnosticCode for KernelError
impl HasKernelDiagnosticCode for KernelError
fn diagnostic_code(&self) -> KernelDiagnosticCode
Source§impl PartialEq for KernelError
impl PartialEq for KernelError
impl Eq for KernelError
impl StructuralPartialEq for KernelError
Auto Trait Implementations§
impl Freeze for KernelError
impl RefUnwindSafe for KernelError
impl Send for KernelError
impl Sync for KernelError
impl Unpin for KernelError
impl UnwindSafe for KernelError
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