#[repr(u32)]pub enum ErrorCode {
Show 28 variants
Success = 0,
ShapeMismatch = 1_000,
InvalidShape = 1_001,
BroadcastError = 1_002,
DimensionMismatch = 1_003,
IndexOutOfBounds = 2_000,
InvalidDimension = 2_001,
InvalidSlice = 2_002,
TypeMismatch = 3_000,
UnsupportedType = 3_001,
ConversionError = 3_002,
DeviceMismatch = 4_000,
DeviceUnavailable = 4_001,
DeviceError = 4_002,
AllocationFailed = 5_000,
OutOfMemory = 5_001,
InvalidAlignment = 5_002,
ComputeError = 6_000,
NumericalError = 6_001,
ConvergenceError = 6_002,
IoError = 7_000,
SerializationError = 7_001,
DeserializationError = 7_002,
InvalidOperation = 8_000,
NotImplemented = 8_001,
InvalidState = 8_002,
SynchronizationError = 8_003,
Unknown = 9_999,
}Expand description
Standard error codes for interoperability with monitoring systems
Variants§
Success = 0
ShapeMismatch = 1_000
InvalidShape = 1_001
BroadcastError = 1_002
DimensionMismatch = 1_003
IndexOutOfBounds = 2_000
InvalidDimension = 2_001
InvalidSlice = 2_002
TypeMismatch = 3_000
UnsupportedType = 3_001
ConversionError = 3_002
DeviceMismatch = 4_000
DeviceError = 4_002
AllocationFailed = 5_000
OutOfMemory = 5_001
InvalidAlignment = 5_002
ComputeError = 6_000
NumericalError = 6_001
ConvergenceError = 6_002
IoError = 7_000
SerializationError = 7_001
DeserializationError = 7_002
InvalidOperation = 8_000
NotImplemented = 8_001
InvalidState = 8_002
SynchronizationError = 8_003
Unknown = 9_999
Implementations§
Source§impl ErrorCode
impl ErrorCode
Sourcepub fn description(&self) -> &'static str
pub fn description(&self) -> &'static str
Get human-readable description
Sourcepub fn from_torsh_error(error: &TorshError) -> Self
pub fn from_torsh_error(error: &TorshError) -> Self
Map TorshError to standard error code
Trait Implementations§
impl Copy for ErrorCode
impl Eq for ErrorCode
impl StructuralPartialEq for ErrorCode
Auto Trait Implementations§
impl Freeze for ErrorCode
impl RefUnwindSafe for ErrorCode
impl Send for ErrorCode
impl Sync for ErrorCode
impl Unpin for ErrorCode
impl UnsafeUnpin for ErrorCode
impl UnwindSafe for ErrorCode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more