Skip to main content

OrtErrorCode

Enum OrtErrorCode 

Source
#[repr(i32)]
pub enum OrtErrorCode {
Show 15 variants Ok = 0, Fail = 1, InvalidArgument = 2, NoSuchFile = 3, NoModel = 4, EngineError = 5, RuntimeException = 6, InvalidProtobuf = 7, ModelLoaded = 8, NotImplemented = 9, InvalidGraph = 10, EpFail = 11, ModelLoadCanceled = 12, ModelRequiresCompilation = 13, NotFound = 14,
}
Expand description

OrtErrorCode — the status code GetErrorCode returns and CreateStatus accepts (onnxruntime_c_api.h:257-273). #[repr(i32)] makes it ABI-compatible with the c_int-typed generated status API (CreateStatusFn / GetErrorCodeFn — both map the C OrtErrorCode to c_int).

Variants§

§

Ok = 0

ORT_OK — success.

§

Fail = 1

ORT_FAIL — generic failure; also the code custom-op kernels surface on error.

§

InvalidArgument = 2

ORT_INVALID_ARGUMENT.

§

NoSuchFile = 3

ORT_NO_SUCHFILE.

§

NoModel = 4

ORT_NO_MODEL.

§

EngineError = 5

ORT_ENGINE_ERROR.

§

RuntimeException = 6

ORT_RUNTIME_EXCEPTION.

§

InvalidProtobuf = 7

ORT_INVALID_PROTOBUF.

§

ModelLoaded = 8

ORT_MODEL_LOADED.

§

NotImplemented = 9

ORT_NOT_IMPLEMENTED.

§

InvalidGraph = 10

ORT_INVALID_GRAPH.

§

EpFail = 11

ORT_EP_FAIL.

§

ModelLoadCanceled = 12

ORT_MODEL_LOAD_CANCELED.

§

ModelRequiresCompilation = 13

ORT_MODEL_REQUIRES_COMPILATION.

§

NotFound = 14

ORT_NOT_FOUND.

Implementations§

Source§

impl OrtErrorCode

Source

pub fn from_c_int(code: c_int) -> Option<Self>

Map a raw c_int error code to the enum, or None if it is outside the known range (a future ORT version could add codes; st-zrt-local errors use negative codes).

Trait Implementations§

Source§

impl Clone for OrtErrorCode

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for OrtErrorCode

Source§

impl Debug for OrtErrorCode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for OrtErrorCode

Source§

impl PartialEq for OrtErrorCode

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for OrtErrorCode

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.