#[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),
}Expand description
Errors that can occur during model fetching.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
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).
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.
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)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
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
Mutably borrows from an owned value. Read more
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.