JsonDeserializer

Struct JsonDeserializer 

Source
pub struct JsonDeserializer { /* private fields */ }
Expand description

JSON deserializer that implements the ShapeDeserializer trait.

Implementations§

Source§

impl JsonDeserializer

Source

pub fn new(input: &[u8], settings: JsonCodecSettings) -> Self

Creates a new JSON deserializer with the given settings.

Trait Implementations§

Source§

impl ShapeDeserializer for JsonDeserializer

Source§

type Error = JsonDeserializerError

The error type returned by deserialization operations.
Source§

fn read_struct<T, F>( &mut self, schema: &dyn Schema, state: T, consumer: F, ) -> Result<T, Self::Error>
where F: FnMut(T, &dyn Schema, &mut Self) -> Result<T, Self::Error>,

Reads a structure from the deserializer. Read more
Source§

fn read_list<T, F>( &mut self, _schema: &dyn Schema, state: T, consumer: F, ) -> Result<T, Self::Error>
where F: FnMut(T, &mut Self) -> Result<T, Self::Error>,

Reads a list from the deserializer. Read more
Source§

fn read_map<T, F>( &mut self, _schema: &dyn Schema, state: T, consumer: F, ) -> Result<T, Self::Error>
where F: FnMut(T, String, &mut Self) -> Result<T, Self::Error>,

Reads a map from the deserializer. Read more
Source§

fn read_boolean(&mut self, _schema: &dyn Schema) -> Result<bool, Self::Error>

Reads a boolean value.
Source§

fn read_byte(&mut self, _schema: &dyn Schema) -> Result<i8, Self::Error>

Reads a byte (i8) value.
Source§

fn read_short(&mut self, _schema: &dyn Schema) -> Result<i16, Self::Error>

Reads a short (i16) value.
Source§

fn read_integer(&mut self, _schema: &dyn Schema) -> Result<i32, Self::Error>

Reads an integer (i32) value.
Source§

fn read_long(&mut self, _schema: &dyn Schema) -> Result<i64, Self::Error>

Reads a long (i64) value.
Source§

fn read_float(&mut self, _schema: &dyn Schema) -> Result<f32, Self::Error>

Reads a float (f32) value.
Source§

fn read_double(&mut self, _schema: &dyn Schema) -> Result<f64, Self::Error>

Reads a double (f64) value.
Source§

fn read_big_integer( &mut self, _schema: &dyn Schema, ) -> Result<BigInteger, Self::Error>

Reads a big integer value.
Source§

fn read_big_decimal( &mut self, _schema: &dyn Schema, ) -> Result<BigDecimal, Self::Error>

Reads a big decimal value.
Source§

fn read_string(&mut self, _schema: &dyn Schema) -> Result<String, Self::Error>

Reads a string value.
Source§

fn read_blob(&mut self, _schema: &dyn Schema) -> Result<Blob, Self::Error>

Reads a blob (byte array) value.
Source§

fn read_timestamp( &mut self, _schema: &dyn Schema, ) -> Result<DateTime, Self::Error>

Reads a timestamp value.
Source§

fn read_document( &mut self, _schema: &dyn Schema, ) -> Result<Document, Self::Error>

Reads a document value.
Source§

fn is_null(&self) -> bool

Checks if the current value is null. Read more
Source§

fn container_size(&self) -> Option<usize>

Returns the size of the current container if known. 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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more