#[non_exhaustive]pub struct MalformedJson {
pub byte: u8,
pub values_emitted: usize,
}Expand description
Error produced by a JsonSplitter
running in strict mode when the byte stream violates top-level JSON
framing — for example a stray closing bracket (} or ]) at depth zero, as
in }{"a":1}.
The default (non-strict) splitter never produces this error: it is a
framing scanner, not a validator. Strict mode is opt-in via
JsonSplitter::strict for
callers that want adversarial framing rejected up front rather than passing
a malformed value on to a real JSON parser.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.byte: u8The offending byte (e.g. b'}' or b']').
values_emitted: usizeHow many top-level values had already been emitted before the violation, which helps a caller locate the bad frame.
Trait Implementations§
Source§impl Clone for MalformedJson
impl Clone for MalformedJson
Source§fn clone(&self) -> MalformedJson
fn clone(&self) -> MalformedJson
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MalformedJson
impl Debug for MalformedJson
Source§impl Display for MalformedJson
impl Display for MalformedJson
impl Eq for MalformedJson
Source§impl Error for MalformedJson
Available on crate feature std only.
impl Error for MalformedJson
Available on crate feature
std only.1.30.0 · 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()
Source§impl From<MalformedJson> for FinishError
impl From<MalformedJson> for FinishError
Source§fn from(e: MalformedJson) -> Self
fn from(e: MalformedJson) -> Self
Converts to this type from the input type.
Source§impl PartialEq for MalformedJson
impl PartialEq for MalformedJson
Source§fn eq(&self, other: &MalformedJson) -> bool
fn eq(&self, other: &MalformedJson) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for MalformedJson
Auto Trait Implementations§
impl Freeze for MalformedJson
impl RefUnwindSafe for MalformedJson
impl Send for MalformedJson
impl Sync for MalformedJson
impl Unpin for MalformedJson
impl UnsafeUnpin for MalformedJson
impl UnwindSafe for MalformedJson
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