pub struct Json;Available on crate feature
json and (crate features json or toml or yaml) only.Expand description
JSON by RFC 8259, with no option that loosens it. Its extension is json.
A strict reading refuses a key written twice in one object, comparing keys after their escapes are decoded, and a listing reading keeps both entries. A number keeps its source text, and a field decides whether it fits.
Trait Implementations§
impl Copy for Json
Source§impl Format for Json
impl Format for Json
Source§fn read(
&self,
text: &str,
limits: &Limits,
reading: Reading,
) -> Result<Node, Refusal>
fn read( &self, text: &str, limits: &Limits, reading: Reading, ) -> Result<Node, Refusal>
Checks max_reader_input_bytes before the first token, max_depth
when an array or an object opens, and max_nodes when a value is
added.
Source§fn resolve<'a>(
&self,
scalar: &'a Scalar,
_tag: Option<&Tag>,
wanted: Wanted,
) -> Result<Resolved<'a>, Mismatch>
fn resolve<'a>( &self, scalar: &'a Scalar, _tag: Option<&Tag>, wanted: Wanted, ) -> Result<Resolved<'a>, Mismatch>
Resolves by the type the scalar’s syntax gave it, and never by its
text. A scalar that carries no syntax, such as one another format built,
is text. A typeless read has no field to say what was expected, so a
number it cannot hold is refused with its text and out of range.
Source§fn extensions(&self) -> &'static [&'static str]
fn extensions(&self) -> &'static [&'static str]
The file extensions the format reads, in lower case and without the
dot, such as
yaml and yml.Auto Trait Implementations§
impl Forget for Json
impl Freeze for Json
impl Move for Json
impl RefUnwindSafe for Json
impl Send for Json
impl Sync for Json
impl Unpin for Json
impl UnsafeUnpin for Json
impl UnwindSafe for Json
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