#[non_exhaustive]pub enum GgufError {
Show 13 variants
NotFile,
InvalidPathUtf8,
UnsupportedExtension,
InteriorNul,
InvalidUtf8,
ArrayKeyAlreadyExists {
key: String,
},
MetadataKeyAlreadyExists {
key: String,
},
WrongMetadataKind {
key: String,
expected: GgufMetadataKind,
actual: GgufMetadataKind,
},
UnsupportedTensorDtype {
dtype: Dtype,
},
UnsupportedMetadataArrayDtype {
dtype: Dtype,
},
InvalidMetadataArrayRank {
rank: usize,
},
EmptyMetadataArray,
Exception(Exception),
}Expand description
An error from GGUF validation or an upstream MLX operation.
Stable Rust-side validation failures have dedicated variants. Other native runtime failures
remain opaque in GgufError::Exception.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NotFile
The load path is not an existing local file.
InvalidPathUtf8
The path cannot be represented by the C string ABI.
UnsupportedExtension
The path does not end in .gguf.
InteriorNul
A path, key, or value contains an interior null byte.
InvalidUtf8
Text returned by the native API is not valid UTF-8.
ArrayKeyAlreadyExists
The array namespace already contains this key.
MetadataKeyAlreadyExists
The metadata namespace already contains this key.
WrongMetadataKind
A typed getter was used for a different metadata kind.
Fields
expected: GgufMetadataKindThe kind requested by the getter.
actual: GgufMetadataKindThe kind stored in the container.
UnsupportedTensorDtype
The tensor dtype is not supported by the MLX 0.32.2 GGUF writer.
UnsupportedMetadataArrayDtype
The metadata-array dtype is not supported by the MLX 0.32.2 GGUF writer.
InvalidMetadataArrayRank
Metadata arrays may only be scalar or one-dimensional.
EmptyMetadataArray
Metadata arrays must contain at least one element.
Exception(Exception)
An opaque error reported by MLX.
Trait Implementations§
Source§impl Error for GgufError
impl Error for GgufError
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()
Auto Trait Implementations§
impl Freeze for GgufError
impl RefUnwindSafe for GgufError
impl Send for GgufError
impl Sync for GgufError
impl Unpin for GgufError
impl UnsafeUnpin for GgufError
impl UnwindSafe for GgufError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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 moreSource§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Option.