#[non_exhaustive]pub enum FetchError {
Api(ApiError),
Io {
path: PathBuf,
source: Error,
},
RepoNotFound {
repo_id: String,
},
Auth {
reason: String,
},
InvalidPattern {
pattern: String,
reason: String,
},
Checksum {
filename: String,
expected: String,
actual: String,
},
Timeout {
filename: String,
seconds: u64,
},
PartialDownload {
path: Option<PathBuf>,
failures: Vec<FileFailure>,
},
ChunkedDownload {
filename: String,
reason: String,
},
Http(String),
InvalidArgument(String),
NoFilesMatched {
repo_id: String,
},
}Expand description
Errors that can occur during model fetching.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Api(ApiError)
The hf-hub API returned an error.
Io
An I/O error occurred while accessing the local filesystem.
RepoNotFound
The repository was not found or is inaccessible.
Auth
Authentication failed (missing or invalid token).
Reserved for future use. Currently, auth failures surface as
FetchError::Api because hf-hub does not distinguish them.
InvalidPattern
An invalid glob pattern was provided for filtering.
Fields
Checksum
SHA256 checksum mismatch after download.
Fields
Timeout
A download operation timed out.
PartialDownload
One or more files failed to download.
Contains the successful path and a list of per-file failures.
Fields
failures: Vec<FileFailure>Per-file failure details.
ChunkedDownload
A chunked (multi-connection) download failed.
Http(String)
An HTTP request to the HuggingFace API failed.
InvalidArgument(String)
An invalid argument was provided.
NoFilesMatched
The repository exists but no files matched after filtering, or the repository contains no files at all.
Trait Implementations§
Source§impl Debug for FetchError
impl Debug for FetchError
Source§impl Display for FetchError
impl Display for FetchError
Source§impl Error for FetchError
impl Error for FetchError
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
Auto Trait Implementations§
impl !Freeze for FetchError
impl !RefUnwindSafe for FetchError
impl Send for FetchError
impl Sync for FetchError
impl Unpin for FetchError
impl UnsafeUnpin for FetchError
impl !UnwindSafe for FetchError
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.