JsonDeserialize

Trait JsonDeserialize 

Source
pub trait JsonDeserialize: Sized {
    // Required method
    fn deserialize<'bytes, 'parent, B: BytesLike<'bytes>, S: Stack>(
        value: Value<'bytes, 'parent, B, S>,
    ) -> Result<Self, JsonError<'bytes, B, S>>;
}
Expand description

An item which can be deserialized from a Value.

This will deserialize the object present without limitation. This should be kept in mind when deserializing into types which allocate.

Required Methods§

Source

fn deserialize<'bytes, 'parent, B: BytesLike<'bytes>, S: Stack>( value: Value<'bytes, 'parent, B, S>, ) -> Result<Self, JsonError<'bytes, B, S>>

Decode this item from a Value.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl JsonDeserialize for bool

Source§

fn deserialize<'bytes, 'parent, B: BytesLike<'bytes>, S: Stack>( value: Value<'bytes, 'parent, B, S>, ) -> Result<Self, JsonError<'bytes, B, S>>

Source§

impl JsonDeserialize for f64

Source§

fn deserialize<'bytes, 'parent, B: BytesLike<'bytes>, S: Stack>( value: Value<'bytes, 'parent, B, S>, ) -> Result<Self, JsonError<'bytes, B, S>>

Source§

impl JsonDeserialize for i8

Source§

fn deserialize<'bytes, 'parent, B: BytesLike<'bytes>, S: Stack>( value: Value<'bytes, 'parent, B, S>, ) -> Result<Self, JsonError<'bytes, B, S>>

Source§

impl JsonDeserialize for i16

Source§

fn deserialize<'bytes, 'parent, B: BytesLike<'bytes>, S: Stack>( value: Value<'bytes, 'parent, B, S>, ) -> Result<Self, JsonError<'bytes, B, S>>

Source§

impl JsonDeserialize for i32

Source§

fn deserialize<'bytes, 'parent, B: BytesLike<'bytes>, S: Stack>( value: Value<'bytes, 'parent, B, S>, ) -> Result<Self, JsonError<'bytes, B, S>>

Source§

impl JsonDeserialize for i64

Source§

fn deserialize<'bytes, 'parent, B: BytesLike<'bytes>, S: Stack>( value: Value<'bytes, 'parent, B, S>, ) -> Result<Self, JsonError<'bytes, B, S>>

Source§

impl JsonDeserialize for u8

Source§

fn deserialize<'bytes, 'parent, B: BytesLike<'bytes>, S: Stack>( value: Value<'bytes, 'parent, B, S>, ) -> Result<Self, JsonError<'bytes, B, S>>

Source§

impl JsonDeserialize for u16

Source§

fn deserialize<'bytes, 'parent, B: BytesLike<'bytes>, S: Stack>( value: Value<'bytes, 'parent, B, S>, ) -> Result<Self, JsonError<'bytes, B, S>>

Source§

impl JsonDeserialize for u32

Source§

fn deserialize<'bytes, 'parent, B: BytesLike<'bytes>, S: Stack>( value: Value<'bytes, 'parent, B, S>, ) -> Result<Self, JsonError<'bytes, B, S>>

Source§

impl JsonDeserialize for u64

Source§

fn deserialize<'bytes, 'parent, B: BytesLike<'bytes>, S: Stack>( value: Value<'bytes, 'parent, B, S>, ) -> Result<Self, JsonError<'bytes, B, S>>

Source§

impl JsonDeserialize for String

Available on crate feature alloc only.
Source§

fn deserialize<'bytes, 'parent, B: BytesLike<'bytes>, S: Stack>( value: Value<'bytes, 'parent, B, S>, ) -> Result<Self, JsonError<'bytes, B, S>>

Source§

impl<T: 'static + Default + JsonDeserialize, const N: usize> JsonDeserialize for [T; N]

Source§

fn deserialize<'bytes, 'parent, B: BytesLike<'bytes>, S: Stack>( value: Value<'bytes, 'parent, B, S>, ) -> Result<Self, JsonError<'bytes, B, S>>

Source§

impl<T: 'static + JsonDeserialize> JsonDeserialize for Vec<T>

Available on crate feature alloc only.
Source§

fn deserialize<'bytes, 'parent, B: BytesLike<'bytes>, S: Stack>( value: Value<'bytes, 'parent, B, S>, ) -> Result<Self, JsonError<'bytes, B, S>>

Source§

impl<T: JsonDeserialize> JsonDeserialize for Option<T>

Source§

fn deserialize<'bytes, 'parent, B: BytesLike<'bytes>, S: Stack>( value: Value<'bytes, 'parent, B, S>, ) -> Result<Self, JsonError<'bytes, B, S>>

This will accept null as a representation of None.

Implementors§