pub struct SerdeJson;Trait Implementations§
Source§impl<'a> JsonArrayAccess<'a, SerdeJson> for &'a [Value]
impl<'a> JsonArrayAccess<'a, SerdeJson> for &'a [Value]
Source§impl<'a> JsonNode<'a, SerdeJson> for &'a Value
impl<'a> JsonNode<'a, SerdeJson> for &'a Value
type Object = &'a Map<String, Value>
type Array = &'a [Value]
fn as_object(&self) -> Option<&'a Map<String, Value>>
fn as_array(&self) -> Option<&'a [Value]>
fn as_string(&self) -> Option<Cow<'a, str>>
Source§fn as_number(&self) -> Option<Cow<'a, Number>>
fn as_number(&self) -> Option<Cow<'a, Number>>
Borrowed for
serde_json, cheaply owned elsewhere; Number keeps the existing numeric machinery
applicable to every representation.fn as_boolean(&self) -> Option<bool>
fn is_null(&self) -> bool
Source§fn json_type(&self) -> JsonType
fn json_type(&self) -> JsonType
The JSON type of this node; numbers always report
JsonType::Number (integer distinction is a
numeric property, not a type tag).Source§fn string_length(&self) -> Option<u64>
fn string_length(&self) -> Option<u64>
String length in Unicode code points, without extracting the bytes where the representation allows.
Source§fn equals_value(&self, expected: &Value) -> bool
fn equals_value(&self, expected: &Value) -> bool
Deep equality against a schema constant (
const/enum); numbers compare mathematically.Source§fn to_value(&self) -> Cow<'a, Value>
fn to_value(&self) -> Cow<'a, Value>
The node as a
serde_json::Value; borrowed for serde_json, materialized elsewhere. Intended for
cold paths (error construction, annotations).Source§fn cache_key(&self) -> Option<usize>
fn cache_key(&self) -> Option<usize>
Identity for the
is_valid result cache; None disables caching for this node.Source§fn is_number(&self) -> bool
fn is_number(&self) -> bool
Whether this node is a JSON number, answered without materializing the numeric value.
Representations where
as_number must construct or format (e.g. Python floats under
arbitrary precision) override this to skip that cost. Must agree with as_number().is_some().Source§fn is_string(&self) -> bool
fn is_string(&self) -> bool
Sugar over
JsonNode::json_type, the single source of type classification.Source§fn container_cache_key(&self) -> Option<usize>
fn container_cache_key(&self) -> Option<usize>
Cache identity restricted to containers, where identities are stable for the whole validation call.
Source§impl<'a> JsonObjectAccess<'a, SerdeJson> for &'a Map<String, Value>
impl<'a> JsonObjectAccess<'a, SerdeJson> for &'a Map<String, Value>
type Node = &'a Value
Source§type MemberName = &'a str
type MemberName = &'a str
Member name handle; a plain
&str where the representation can borrow, owned elsewhere.type MembersIter = SerdeMembersIter<'a>
fn len(&self) -> usize
fn get(&self, key: &String) -> Option<&'a Value>
fn members(&self) -> SerdeMembersIter<'a>
fn is_empty(&self) -> bool
Auto Trait Implementations§
impl Freeze for SerdeJson
impl RefUnwindSafe for SerdeJson
impl Send for SerdeJson
impl Sync for SerdeJson
impl Unpin for SerdeJson
impl UnsafeUnpin for SerdeJson
impl UnwindSafe for SerdeJson
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