Struct nanoserde::DeJsonState

source ·
pub struct DeJsonState {
    pub cur: char,
    pub tok: DeJsonTok,
    pub strbuf: String,
    pub numbuf: String,
    pub identbuf: String,
    pub line: usize,
    pub col: usize,
}
Expand description

The internal state of a JSON deserialization.

Fields§

§cur: char§tok: DeJsonTok§strbuf: String§numbuf: String§identbuf: String§line: usize§col: usize

Implementations§

source§

impl DeJsonState

source

pub fn next(&mut self, i: &mut Chars<'_>)

source

pub fn err_exp(&self, name: &str) -> DeJsonErr

source

pub fn err_nf(&self, name: &str) -> DeJsonErr

source

pub fn err_enum(&self, name: &str) -> DeJsonErr

source

pub fn err_token(&self, what: &str) -> DeJsonErr

source

pub fn err_range(&self, what: &str) -> DeJsonErr

source

pub fn err_type(&self, what: &str) -> DeJsonErr

source

pub fn err_parse(&self, what: &str) -> DeJsonErr

source

pub fn eat_comma_block(&mut self, i: &mut Chars<'_>) -> Result<(), DeJsonErr>

source

pub fn whole_field(&mut self, i: &mut Chars<'_>) -> Result<(), DeJsonErr>

source

pub fn eat_comma_curly(&mut self, i: &mut Chars<'_>) -> Result<(), DeJsonErr>

source

pub fn colon(&mut self, i: &mut Chars<'_>) -> Result<(), DeJsonErr>

source

pub fn string(&mut self, i: &mut Chars<'_>) -> Result<(), DeJsonErr>

source

pub fn next_colon(&mut self, i: &mut Chars<'_>) -> Result<(), DeJsonErr>

source

pub fn next_str(&mut self) -> Option<()>

source

pub fn block_open(&mut self, i: &mut Chars<'_>) -> Result<(), DeJsonErr>

source

pub fn block_close(&mut self, i: &mut Chars<'_>) -> Result<(), DeJsonErr>

source

pub fn curly_open(&mut self, i: &mut Chars<'_>) -> Result<(), DeJsonErr>

source

pub fn curly_close(&mut self, i: &mut Chars<'_>) -> Result<(), DeJsonErr>

source

pub fn u64_range(&mut self, max: u64) -> Result<u64, DeJsonErr>

source

pub fn i64_range(&mut self, min: i64, max: i64) -> Result<i64, DeJsonErr>

source

pub fn as_f64(&mut self) -> Result<f64, DeJsonErr>

source

pub fn as_bool(&mut self) -> Result<bool, DeJsonErr>

source

pub fn as_string(&mut self) -> Result<String, DeJsonErr>

source

pub fn next_tok(&mut self, i: &mut Chars<'_>) -> Result<(), DeJsonErr>

Trait Implementations§

source§

impl Default for DeJsonState

source§

fn default() -> DeJsonState

Returns the “default value” for a type. Read more

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<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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.