Skip to main content

HjsonDecoder

Struct HjsonDecoder 

Source
pub struct HjsonDecoder<'de> { /* private fields */ }
Expand description

Streaming Hjson decoder.

Implementations§

Source§

impl<'de> HjsonDecoder<'de>

Source

pub fn new(input: &'de [u8]) -> Self

Create a decoder over input.

Source

pub fn end(&mut self) -> Result<()>

Validate that the whole input was consumed.

Trait Implementations§

Source§

impl<'de> FormatDecoder<'de> for HjsonDecoder<'de>

Source§

type Error = Error

The error type produced by this format’s methods. Read more
Source§

fn begin_object(&mut self) -> Result<(), Self::Error>

Consume { (with depth check).
Source§

fn end_object(&mut self) -> Result<(), Self::Error>

Consume }.
Source§

fn object_key(&mut self) -> Result<Option<Cow<'de, str>>, Self::Error>

Read the next object key; returns None on } (not consumed).
Source§

fn object_entry_sep(&mut self) -> Result<bool, Self::Error>

Object entry separator: true if more entries follow, false at end.
Source§

fn begin_array(&mut self) -> Result<(), Self::Error>

Consume [ (with depth check).
Source§

fn end_array(&mut self) -> Result<(), Self::Error>

Consume ].
Source§

fn array_has_more(&mut self) -> Result<bool, Self::Error>

Whether the array has more elements (] not consumed).
Source§

fn array_entry_sep(&mut self) -> Result<bool, Self::Error>

Array entry separator: true if more elements follow, false at end.
Source§

fn unit(&mut self) -> Result<(), Self::Error>

Consume null.
Source§

fn bool(&mut self) -> Result<bool, Self::Error>

Read a boolean.
Source§

fn number(&mut self) -> Result<Number, Self::Error>

Read a number.
Source§

fn string(&mut self) -> Result<Cow<'de, str>, Self::Error>

Read a string (may borrow the source).
Source§

fn char(&mut self) -> Result<char, Self::Error>

Read a single character (a one-scalar string).
Source§

fn skip_value(&mut self) -> Result<(), Self::Error>

Skip any one value.
Source§

fn peek_token(&mut self) -> Result<Token<'de>, Self::Error>

Peek the next token without consuming it (container-flatten support).
Source§

fn next_token(&mut self) -> Result<Token<'de>, Self::Error>

Consume and return the next token.
Source§

fn save(&self) -> Mark

Save the current position (for untagged-enum backtracking).
Source§

fn restore(&mut self, mark: Mark)

Restore a position saved with save.
Source§

fn i8(&mut self) -> Result<i8, Self::Error>

Read a $t (default: read a number and convert). Read more
Source§

fn i16(&mut self) -> Result<i16, Self::Error>

Read a $t (default: read a number and convert). Read more
Source§

fn i32(&mut self) -> Result<i32, Self::Error>

Read a $t (default: read a number and convert). Read more
Source§

fn i64(&mut self) -> Result<i64, Self::Error>

Read a $t (default: read a number and convert). Read more
Source§

fn i128(&mut self) -> Result<i128, Self::Error>

Read a $t (default: read a number and convert). Read more
Source§

fn isize(&mut self) -> Result<isize, Self::Error>

Read a $t (default: read a number and convert). Read more
Source§

fn u8(&mut self) -> Result<u8, Self::Error>

Read a $t (default: read a number and convert). Read more
Source§

fn u16(&mut self) -> Result<u16, Self::Error>

Read a $t (default: read a number and convert). Read more
Source§

fn u32(&mut self) -> Result<u32, Self::Error>

Read a $t (default: read a number and convert). Read more
Source§

fn u64(&mut self) -> Result<u64, Self::Error>

Read a $t (default: read a number and convert). Read more
Source§

fn u128(&mut self) -> Result<u128, Self::Error>

Read a $t (default: read a number and convert). Read more
Source§

fn usize(&mut self) -> Result<usize, Self::Error>

Read a $t (default: read a number and convert). Read more
Source§

fn bytes(&mut self) -> Result<Cow<'de, [u8]>, Self::Error>

Read a byte sequence (may borrow the source). Read more
Source§

fn option_tag(&mut self) -> Result<OptionTag, Self::Error>

Report whether the next value is Option::None or Option::Some. Read more
Source§

fn map_key<K: for<'a> NsonDeserialize<'a>>( &mut self, ) -> Result<Option<K>, Self::Error>

Read the next map key. Read more
Source§

fn is_human_readable(&self) -> bool

Whether this format produces human-readable output. Read more

Auto Trait Implementations§

§

impl<'de> Freeze for HjsonDecoder<'de>

§

impl<'de> RefUnwindSafe for HjsonDecoder<'de>

§

impl<'de> Send for HjsonDecoder<'de>

§

impl<'de> Sync for HjsonDecoder<'de>

§

impl<'de> Unpin for HjsonDecoder<'de>

§

impl<'de> UnsafeUnpin for HjsonDecoder<'de>

§

impl<'de> UnwindSafe for HjsonDecoder<'de>

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

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.