pub enum Error {
Message {
msg: String,
},
Format {
error: Error,
},
IO {
error: Error,
},
Unexpected {
msg: String,
},
}Expand description
Error type used by the YAML serializer.
This type is re-exported as serde_saphyr::ser::Error and is returned by
the public serialization APIs (for example serde_saphyr::to_string).
It implements serde::ser::Error, which allows user Serialize impls and
Serde derives to report failures via S::Error::custom(...). Such
free‑form messages are stored in the Message variant.
Other variants wrap concrete underlying failures that can occur while serializing:
Formatwraps astd::fmt::Errorproduced when writing to afmt::Writetarget.IOwraps astd::io::Errorproduced when writing to anio::Writetarget.Unexpectedis used internally for invariant violations (e.g., around anchors). It should not normally surface; if it does, please file a bug.
Variants§
Message
Free-form error.
Format
Wrapper for formatting errors.
IO
Wrapper for I/O errors.
Unexpected
This is used with anchors and should normally not surface, please report bug if it does.
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)>
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 Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe 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
Mutably borrows from an owned value. Read more