Trait nanoserde::DeJson[][src]

pub trait DeJson: Sized {
    fn de_json(
        state: &mut DeJsonState,
        input: &mut Chars<'_>
    ) -> Result<Self, DeJsonErr>; fn deserialize_json(input: &str) -> Result<Self, DeJsonErr> { ... } }
Expand description

A trait for objects that can be deserialized from JSON.

Required methods

Parse Self from the input string.

let mut state = DeJsonState::default();
let mut chars = "42".chars();
state.next(&mut chars);
state.next_tok(&mut chars).unwrap();
let out = u32::de_json(&mut state, &mut chars).unwrap();
assert_eq!(out, 42);

Provided methods

Parse Self from the input string.

This is a convenient wrapper around de_json.

Implementations on Foreign Types

Implementors