#[repr(u32)]pub enum ErrorCode {
Show 47 variants
TensorCreationFailed = 1_000,
TensorOperationFailed = 1_001,
ShapeMismatch = 1_002,
DTypeMismatch = 1_003,
DeviceMismatch = 1_004,
TensorNotFound = 1_005,
AllocationFailed = 2_000,
MemoryPoolExhausted = 2_001,
OutOfMemory = 2_002,
MemoryLeakDetected = 2_003,
InvalidPointer = 2_004,
DanglingPointer = 2_005,
InvalidConversion = 3_000,
TypeNotSupported = 3_001,
PrecisionLoss = 3_002,
OverflowDetected = 3_003,
UnderflowDetected = 3_004,
InvalidParameter = 4_000,
ParameterOutOfRange = 4_001,
NullPointer = 4_002,
InvalidShape = 4_003,
InvalidDType = 4_004,
InvalidDevice = 4_005,
OperationNotSupported = 5_000,
OperationFailed = 5_001,
BroadcastingFailed = 5_002,
MatrixNotInvertible = 5_003,
DivisionByZero = 5_004,
PythonError = 6_000,
JavaError = 6_001,
CSharpError = 6_002,
GoError = 6_003,
SwiftError = 6_004,
WasmError = 6_005,
FileNotFound = 7_000,
FileReadError = 7_001,
FileWriteError = 7_002,
SerializationFailed = 7_003,
DeserializationFailed = 7_004,
ModuleNotFound = 8_000,
ModuleInitFailed = 8_001,
ModuleLoadError = 8_002,
OwnershipConflict = 9_000,
DataRace = 9_001,
DeadlockDetected = 9_002,
Unknown = 10_000,
Internal = 10_001,
}Expand description
Structured error codes for machine-readable error handling
Variants§
TensorCreationFailed = 1_000
TensorOperationFailed = 1_001
ShapeMismatch = 1_002
DTypeMismatch = 1_003
DeviceMismatch = 1_004
TensorNotFound = 1_005
AllocationFailed = 2_000
MemoryPoolExhausted = 2_001
OutOfMemory = 2_002
MemoryLeakDetected = 2_003
InvalidPointer = 2_004
DanglingPointer = 2_005
InvalidConversion = 3_000
TypeNotSupported = 3_001
PrecisionLoss = 3_002
OverflowDetected = 3_003
UnderflowDetected = 3_004
InvalidParameter = 4_000
ParameterOutOfRange = 4_001
NullPointer = 4_002
InvalidShape = 4_003
InvalidDType = 4_004
InvalidDevice = 4_005
OperationNotSupported = 5_000
OperationFailed = 5_001
BroadcastingFailed = 5_002
MatrixNotInvertible = 5_003
DivisionByZero = 5_004
PythonError = 6_000
JavaError = 6_001
CSharpError = 6_002
GoError = 6_003
SwiftError = 6_004
WasmError = 6_005
FileNotFound = 7_000
FileReadError = 7_001
FileWriteError = 7_002
SerializationFailed = 7_003
DeserializationFailed = 7_004
ModuleNotFound = 8_000
ModuleInitFailed = 8_001
ModuleLoadError = 8_002
OwnershipConflict = 9_000
DataRace = 9_001
DeadlockDetected = 9_002
Unknown = 10_000
Internal = 10_001
Implementations§
Source§impl ErrorCode
impl ErrorCode
Sourcepub fn category(&self) -> ErrorCategory
pub fn category(&self) -> ErrorCategory
Get error category
Sourcepub fn default_severity(&self) -> Severity
pub fn default_severity(&self) -> Severity
Get default severity for this error code
Trait Implementations§
impl Copy for ErrorCode
Source§impl<'de> Deserialize<'de> for ErrorCode
impl<'de> Deserialize<'de> for ErrorCode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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
impl<T> Scalar for T
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.