#[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
impl OrtErrorCode
Sourcepub fn from_c_int(code: c_int) -> Option<Self>
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).