Skip to main content

SerdeJson

Struct SerdeJson 

Source
pub struct SerdeJson;

Trait Implementations§

Source§

impl<'a> Array<'a, SerdeJson> for &'a [Value]

Source§

type Node = &'a Value

Source§

type ElementsIter = Iter<'a, Value>

Source§

fn len(&self) -> usize

Source§

fn elements(&self) -> Iter<'a, Value>

Source§

fn is_unique(&self) -> bool

uniqueItems: every element distinct under JSON equality.
Source§

impl Json for SerdeJson

Source§

type Node<'a> = &'a Value

Source§

type PreparedKey = String

Property name prepared once at compile time, for repeated object lookups.
Source§

type StringBuffer = Value

Scratch storage for Json::with_string_node, reusable across calls.
Source§

fn prepare_key(key: &str) -> String

Source§

fn with_string_node<T>( buffer: &mut Value, string: &str, f: impl FnOnce(&Value) -> T, ) -> T

Call f with a node holding string, backed by buffer. Read more
Source§

impl<'a> Node<'a, SerdeJson> for &'a Value

Source§

type Object = &'a Map<String, Value>

Source§

type Array = &'a [Value]

Source§

type Number = &'a Number

Source§

fn as_object(&self) -> Option<&'a Map<String, Value>>

Source§

fn as_array(&self) -> Option<&'a [Value]>

Source§

fn as_string(&self) -> Option<Cow<'a, str>>

Source§

fn as_number(&self) -> Option<&'a Number>

Source§

fn as_boolean(&self) -> Option<bool>

Source§

fn is_null(&self) -> bool

Source§

fn json_type(&self) -> JsonType

Numbers always report JsonType::Number; integer-ness is a numeric property, not a type.
Source§

fn string_length(&self) -> Option<u64>

Length in Unicode code points.
Source§

fn equals_value(&self, expected: &Value) -> bool

Equality against a const/enum value; numbers compare mathematically.
Source§

fn to_value(&self) -> Cow<'a, Value>

For cold paths only: error construction, annotations, the equals_value and is_unique defaults (const/enum/uniqueItems), and serde-only custom keywords.
Source§

fn identity(&self) -> Option<NodeIdentity>

Identity for $ref cycle detection and is_valid memoization. Read more
Source§

fn is_number(&self) -> bool

Must agree with as_number().is_some(); override where as_number has to construct.
Source§

fn is_string(&self) -> bool

Source§

fn container_identity(&self) -> Option<NodeIdentity>

Source§

impl<'a> Object<'a, SerdeJson> for &'a Map<String, Value>

Source§

type Node = &'a Value

Source§

type MemberName = &'a str

Source§

type MembersIter = SerdeMembersIter<'a>

Source§

fn len(&self) -> usize

Source§

fn get(&self, key: &String) -> Option<&'a Value>

Source§

fn members(&self) -> SerdeMembersIter<'a>

Source§

fn is_empty(&self) -> bool

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.