#[non_exhaustive]pub enum FormatError {
Io(Error),
Decode(Box<dyn Error + Send + Sync>),
Encode {
reason: Box<str>,
},
Data(Box<DataError>),
Path(Box<PathParseError>),
}Expand description
Error returned by FileFormat::read and FileFormat::write.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io(Error)
Byte I/O against the asset failed (resolver open, read, seek, write).
Decode(Box<dyn Error + Send + Sync>)
The asset’s bytes could not be decoded as this format. Transparent:
Display and source are the boxed format error’s own, so a rich decode
diagnostic (e.g. a usda parse error’s caret rendering) survives to
the caller and stays downcastable. Boxed so sdf stays below the
concrete formats and external FileFormat implementors can report
their own decode errors.
Encode
The data holds something this format cannot encode.
Data(Box<DataError>)
Reading a field value out of the layer’s data failed while serializing
it (a lazy backend could not decode the authored value). Boxed, with
Path, to keep the enum small — the assertion below
pins it, since this error rides the writers’ per-element loops.
Path(Box<PathParseError>)
A name in the data does not form a valid sdf path while walking the
hierarchy for serialization.
Trait Implementations§
Source§impl Debug for FormatError
impl Debug for FormatError
Source§impl Display for FormatError
impl Display for FormatError
Source§impl Error for FormatError
impl Error for FormatError
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<DataError> for FormatError
impl From<DataError> for FormatError
Source§impl From<Error> for FormatError
impl From<Error> for FormatError
Source§impl From<Error> for FormatError
A Display implementation failed while formatting a value into text.
fmt::Error carries no detail, so the message is fixed.
impl From<Error> for FormatError
A Display implementation failed while formatting a value into text.
fmt::Error carries no detail, so the message is fixed.