#[non_exhaustive]pub enum Error {
Show 14 variants
Io(Error),
Json(Error),
Utf8(Utf8Error),
Decode {
key: String,
message: String,
},
Encode {
key: String,
message: String,
},
MissingKey {
wanted: Vec<String>,
available: Vec<String>,
},
DuplicateKey {
key: String,
sample_key: String,
},
Security(String),
Subprocess(String),
Format(String),
Unsupported(String),
Value(String),
Empty(String),
Context {
context: String,
source: Box<Error>,
},
}Expand description
The error type used throughout the webdataset crates.
Errors carry enough context to be reported usefully by the pluggable
Handler implementations: the URL of the shard
and the key of the sample are attached as they travel up the pipeline.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io(Error)
std only.An underlying I/O failure.
Json(Error)
json only.A JSON value could not be parsed or serialized.
Utf8(Utf8Error)
Bytes that were expected to be UTF-8 were not.
Decode
A sample field could not be decoded.
Fields
Encode
A sample field could not be encoded for writing.
Fields
MissingKey
A required key was not present in a sample.
Fields
DuplicateKey
The same key occurred twice while grouping files into a sample.
Fields
Security(String)
An operation was refused because secure mode is enabled.
Subprocess(String)
A subprocess used to open a URL failed.
Format(String)
Malformed input data (bad archive, bad header, bad brace expression).
Unsupported(String)
The requested functionality is not available in this build.
Value(String)
A value had the right shape but the wrong contents.
Empty(String)
A pipeline stage that was declared non-empty produced no data.
Context
An error with additional context attached.
Implementations§
Source§impl Error
impl Error
Sourcepub fn format(message: impl Display) -> Self
pub fn format(message: impl Display) -> Self
Build an Error::Format from anything printable.
Sourcepub fn value(message: impl Display) -> Self
pub fn value(message: impl Display) -> Self
Build an Error::Value from anything printable.
Sourcepub fn unsupported(message: impl Display) -> Self
pub fn unsupported(message: impl Display) -> Self
Build an Error::Unsupported from anything printable.
Sourcepub fn decode(key: impl Into<String>, message: impl Display) -> Self
pub fn decode(key: impl Into<String>, message: impl Display) -> Self
Build an Error::Decode for the given field.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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 !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
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> CustomValue for T
impl<T> CustomValue for T
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