Struct tc_value::ValueVisitor [−][src]
pub struct ValueVisitor;
Expand description
A struct for deserializing a Value
which implements destream::de::Visitor
and serde::de::Visitor
.
Implementations
Trait Implementations
Returns the “default value” for a type. Read more
Format a message stating what data this Visitor
expects to receive. Read more
The input contains a boolean. Read more
The input contains an i8
. Read more
The input contains an i16
. Read more
The input contains an i32
. Read more
The input contains an i64
. Read more
The input contains a u8
. Read more
The input contains a u16
. Read more
The input contains a u32
. Read more
The input contains a u64
. Read more
The input contains an f32
. Read more
The input contains an f64
. Read more
The input contains a string and ownership of the string is being given
to the Visitor
. Read more
The input contains a byte array and ownership of the byte array is being
given to the Visitor
. Read more
The input contains a unit ()
. Read more
The input contains an optional that is absent. The default implementation fails with a type error. Read more
The input contains a key-value map. The default implementation fails with a type error. Read more
The input contains a sequence of elements. The default implementation fails with a type error. Read more
fn visit_array_bool<'async_trait, A>(
self,
_array: A
) -> Pin<Box<dyn Future<Output = Result<Self::Value, <A as ArrayAccess<bool>>::Error>> + 'async_trait + Send, Global>> where
Self: 'async_trait,
A: ArrayAccess<bool> + 'async_trait,
fn visit_array_bool<'async_trait, A>(
self,
_array: A
) -> Pin<Box<dyn Future<Output = Result<Self::Value, <A as ArrayAccess<bool>>::Error>> + 'async_trait + Send, Global>> where
Self: 'async_trait,
A: ArrayAccess<bool> + 'async_trait,
The input contains an array of bool
s. Read more
fn visit_array_i8<'async_trait, A>(
self,
_array: A
) -> Pin<Box<dyn Future<Output = Result<Self::Value, <A as ArrayAccess<i8>>::Error>> + 'async_trait + Send, Global>> where
Self: 'async_trait,
A: ArrayAccess<i8> + 'async_trait,
fn visit_array_i8<'async_trait, A>(
self,
_array: A
) -> Pin<Box<dyn Future<Output = Result<Self::Value, <A as ArrayAccess<i8>>::Error>> + 'async_trait + Send, Global>> where
Self: 'async_trait,
A: ArrayAccess<i8> + 'async_trait,
The input contains an array of i8
s. Read more
fn visit_array_i16<'async_trait, A>(
self,
_array: A
) -> Pin<Box<dyn Future<Output = Result<Self::Value, <A as ArrayAccess<i16>>::Error>> + 'async_trait + Send, Global>> where
Self: 'async_trait,
A: ArrayAccess<i16> + 'async_trait,
fn visit_array_i16<'async_trait, A>(
self,
_array: A
) -> Pin<Box<dyn Future<Output = Result<Self::Value, <A as ArrayAccess<i16>>::Error>> + 'async_trait + Send, Global>> where
Self: 'async_trait,
A: ArrayAccess<i16> + 'async_trait,
The input contains an array of i16
s. Read more
fn visit_array_i32<'async_trait, A>(
self,
_array: A
) -> Pin<Box<dyn Future<Output = Result<Self::Value, <A as ArrayAccess<i32>>::Error>> + 'async_trait + Send, Global>> where
Self: 'async_trait,
A: ArrayAccess<i32> + 'async_trait,
fn visit_array_i32<'async_trait, A>(
self,
_array: A
) -> Pin<Box<dyn Future<Output = Result<Self::Value, <A as ArrayAccess<i32>>::Error>> + 'async_trait + Send, Global>> where
Self: 'async_trait,
A: ArrayAccess<i32> + 'async_trait,
The input contains an array of i32
s. Read more
fn visit_array_i64<'async_trait, A>(
self,
_array: A
) -> Pin<Box<dyn Future<Output = Result<Self::Value, <A as ArrayAccess<i64>>::Error>> + 'async_trait + Send, Global>> where
Self: 'async_trait,
A: ArrayAccess<i64> + 'async_trait,
fn visit_array_i64<'async_trait, A>(
self,
_array: A
) -> Pin<Box<dyn Future<Output = Result<Self::Value, <A as ArrayAccess<i64>>::Error>> + 'async_trait + Send, Global>> where
Self: 'async_trait,
A: ArrayAccess<i64> + 'async_trait,
The input contains an array of i64
s. Read more
fn visit_array_u8<'async_trait, A>(
self,
_array: A
) -> Pin<Box<dyn Future<Output = Result<Self::Value, <A as ArrayAccess<u8>>::Error>> + 'async_trait + Send, Global>> where
Self: 'async_trait,
A: ArrayAccess<u8> + 'async_trait,
fn visit_array_u8<'async_trait, A>(
self,
_array: A
) -> Pin<Box<dyn Future<Output = Result<Self::Value, <A as ArrayAccess<u8>>::Error>> + 'async_trait + Send, Global>> where
Self: 'async_trait,
A: ArrayAccess<u8> + 'async_trait,
The input contains an array of u8
s. Read more
fn visit_array_u16<'async_trait, A>(
self,
_array: A
) -> Pin<Box<dyn Future<Output = Result<Self::Value, <A as ArrayAccess<u16>>::Error>> + 'async_trait + Send, Global>> where
Self: 'async_trait,
A: ArrayAccess<u16> + 'async_trait,
fn visit_array_u16<'async_trait, A>(
self,
_array: A
) -> Pin<Box<dyn Future<Output = Result<Self::Value, <A as ArrayAccess<u16>>::Error>> + 'async_trait + Send, Global>> where
Self: 'async_trait,
A: ArrayAccess<u16> + 'async_trait,
The input contains an array of u16
s. Read more
fn visit_array_u32<'async_trait, A>(
self,
_array: A
) -> Pin<Box<dyn Future<Output = Result<Self::Value, <A as ArrayAccess<u32>>::Error>> + 'async_trait + Send, Global>> where
Self: 'async_trait,
A: ArrayAccess<u32> + 'async_trait,
fn visit_array_u32<'async_trait, A>(
self,
_array: A
) -> Pin<Box<dyn Future<Output = Result<Self::Value, <A as ArrayAccess<u32>>::Error>> + 'async_trait + Send, Global>> where
Self: 'async_trait,
A: ArrayAccess<u32> + 'async_trait,
The input contains an array of u32
s. Read more
fn visit_array_u64<'async_trait, A>(
self,
_array: A
) -> Pin<Box<dyn Future<Output = Result<Self::Value, <A as ArrayAccess<u64>>::Error>> + 'async_trait + Send, Global>> where
Self: 'async_trait,
A: ArrayAccess<u64> + 'async_trait,
fn visit_array_u64<'async_trait, A>(
self,
_array: A
) -> Pin<Box<dyn Future<Output = Result<Self::Value, <A as ArrayAccess<u64>>::Error>> + 'async_trait + Send, Global>> where
Self: 'async_trait,
A: ArrayAccess<u64> + 'async_trait,
The input contains an array of u64
s. Read more
fn visit_array_f32<'async_trait, A>(
self,
_array: A
) -> Pin<Box<dyn Future<Output = Result<Self::Value, <A as ArrayAccess<f32>>::Error>> + 'async_trait + Send, Global>> where
Self: 'async_trait,
A: ArrayAccess<f32> + 'async_trait,
fn visit_array_f32<'async_trait, A>(
self,
_array: A
) -> Pin<Box<dyn Future<Output = Result<Self::Value, <A as ArrayAccess<f32>>::Error>> + 'async_trait + Send, Global>> where
Self: 'async_trait,
A: ArrayAccess<f32> + 'async_trait,
The input contains an array of f32
s. Read more
fn visit_array_f64<'async_trait, A>(
self,
_array: A
) -> Pin<Box<dyn Future<Output = Result<Self::Value, <A as ArrayAccess<f64>>::Error>> + 'async_trait + Send, Global>> where
Self: 'async_trait,
A: ArrayAccess<f64> + 'async_trait,
fn visit_array_f64<'async_trait, A>(
self,
_array: A
) -> Pin<Box<dyn Future<Output = Result<Self::Value, <A as ArrayAccess<f64>>::Error>> + 'async_trait + Send, Global>> where
Self: 'async_trait,
A: ArrayAccess<f64> + 'async_trait,
The input contains an array of f64
s. Read more
The input contains an optional that is present. The default implementation fails with a type error. Read more
Format a message stating what data this Visitor expects to receive. Read more
The input contains a boolean. Read more
The input contains an i8
. Read more
The input contains an i16
. Read more
The input contains an i32
. Read more
The input contains an i64
. Read more
The input contains a u8
. Read more
The input contains a u16
. Read more
The input contains a u32
. Read more
The input contains a u64
. Read more
The input contains an f32
. Read more
The input contains an f64
. Read more
The input contains a string. The lifetime of the string is ephemeral and it may be destroyed after this method returns. Read more
The input contains a string that lives at least as long as the
Deserializer
. Read more
The input contains a string and ownership of the string is being given
to the Visitor
. Read more
The input contains a byte array and ownership of the byte array is being
given to the Visitor
. Read more
The input contains a unit ()
. Read more
The input contains a sequence of elements. Read more
The input contains a key-value map. Read more
The input contains a i128
. Read more
The input contains a u128
. Read more
The input contains a char
. Read more
The input contains a byte array. The lifetime of the byte array is ephemeral and it may be destroyed after this method returns. Read more
The input contains a byte array that lives at least as long as the
Deserializer
. Read more
The input contains an optional that is absent. Read more
fn visit_some<D>(
self,
deserializer: D
) -> Result<Self::Value, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
fn visit_some<D>(
self,
deserializer: D
) -> Result<Self::Value, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
The input contains an optional that is present. Read more
fn visit_newtype_struct<D>(
self,
deserializer: D
) -> Result<Self::Value, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
fn visit_newtype_struct<D>(
self,
deserializer: D
) -> Result<Self::Value, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
The input contains a newtype struct. Read more
fn visit_enum<A>(
self,
data: A
) -> Result<Self::Value, <A as EnumAccess<'de>>::Error> where
A: EnumAccess<'de>,
fn visit_enum<A>(
self,
data: A
) -> Result<Self::Value, <A as EnumAccess<'de>>::Error> where
A: EnumAccess<'de>,
The input contains an enum. Read more
Auto Trait Implementations
impl RefUnwindSafe for ValueVisitor
impl Send for ValueVisitor
impl Sync for ValueVisitor
impl Unpin for ValueVisitor
impl UnwindSafe for ValueVisitor
Blanket Implementations
Mutably borrows from an owned value. Read more
Returns true
if self
can be cast into the target type T
.
Test if value
can be cast into Self
.
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
Test if self
can be cast into T
.
Returns Some(T)
if self
can be cast into T
, otherwise None
.
fn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err> where
OnErr: FnOnce(&Self) -> Err,
fn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err> where
OnErr: FnOnce(&Self) -> Err,
Returns Ok(T)
if self
can be cast into T
, otherwise calls on_err
.