pub enum WriteError {
Io(Error),
NaNOrInfinity,
EmptyDocument,
MultipleRootValues,
Poisoned,
InvalidOption(&'static str),
FrameMismatch,
KeyOutsideObject,
ExtensionWithoutPayload,
}Expand description
Errors returned by the writer.
After any error mid-document the writer is poisoned: subsequent
calls fail with WriteError::Poisoned instead of producing a
malformed document.
Variants§
Io(Error)
The underlying Sink returned an io::Error.
NaNOrInfinity
f64 was NaN or ±∞.
EmptyDocument
Writer::finish was called with no root
value.
MultipleRootValues
More than one root value was pushed.
Poisoned
A previous error left the writer in an unrecoverable state.
InvalidOption(&'static str)
WriterOptions failed validation.
FrameMismatch
RawWriter::end_array / end_object was called with a
mismatched or absent top frame.
KeyOutsideObject
RawWriter::push_key was called outside an object frame.
ExtensionWithoutPayload
An extension header was written but no payload value followed
before the enclosing frame closed (or finish/snapshot_trailer
was called).
Trait Implementations§
Source§impl Debug for WriteError
impl Debug for WriteError
Source§impl Display for WriteError
impl Display for WriteError
Source§impl Error for WriteError
impl Error for WriteError
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 WriteError
impl !RefUnwindSafe for WriteError
impl Send for WriteError
impl Sync for WriteError
impl Unpin for WriteError
impl UnsafeUnpin for WriteError
impl !UnwindSafe for WriteError
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