#[non_exhaustive]pub struct ModelError {
pub kind: ModelErrorKind,
pub model: Option<String>,
pub expected_sha256: Option<String>,
pub path: Option<PathBuf>,
pub install_command: Option<String>,
pub expected_ort: Option<String>,
pub found_ort: Option<String>,
/* private fields */
}Expand description
A shared-layer failure.
Carries the structured fields callers branch on; converts into
std::io::Error via [std::io::Error::other] so pdf-engine surfaces
it as EngineError::Io without a new variant, downcastable through
model_error.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.kind: ModelErrorKindWhat went wrong.
model: Option<String>The spec name, or "onnxruntime-1.23.2" when the missing or
mismatched file is the runtime library itself.
expected_sha256: Option<String>The digest the file was checked against (ModelErrorKind::ChecksumMismatch).
path: Option<PathBuf>The path looked at: the model file, or the library.
install_command: Option<String>The spec’s install command, shown verbatim when the model is missing.
expected_ort: Option<String>The runtime version required (ModelErrorKind::VersionMismatch).
found_ort: Option<String>The runtime version the library reported (ModelErrorKind::VersionMismatch).
Implementations§
Source§impl ModelError
impl ModelError
Sourcepub fn feature_not_compiled(spec: &ModelSpec, feature: &'static str) -> Self
pub fn feature_not_compiled(spec: &ModelSpec, feature: &'static str) -> Self
The tier is not compiled into this build: a model tier was asked for on a build without the cargo feature that runs it (#641).
ModelErrorKind::ModelNotAvailable, naming the feature to rebuild
with; the Display appends the spec’s install
command, so the message names both the feature and the install.
Trait Implementations§
Source§impl Clone for ModelError
impl Clone for ModelError
Source§impl Debug for ModelError
impl Debug for ModelError
Source§impl Display for ModelError
impl Display for ModelError
Source§impl Error for ModelError
impl Error for ModelError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<ModelError> for Error
impl From<ModelError> for Error
Source§fn from(e: ModelError) -> Self
fn from(e: ModelError) -> Self
Auto Trait Implementations§
impl Freeze for ModelError
impl RefUnwindSafe for ModelError
impl Send for ModelError
impl Sync for ModelError
impl Unpin for ModelError
impl UnsafeUnpin for ModelError
impl UnwindSafe for ModelError
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
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> ⓘ
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> ⓘ
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