Skip to main content

FromValueVisitor

Struct FromValueVisitor 

Source
pub struct FromValueVisitor<T> { /* private fields */ }
Expand description

A visitor that collects values into a type using FromValue.

Implementations§

Source§

impl<T> FromValueVisitor<T>

Source

pub fn new() -> Self

Trait Implementations§

Source§

impl<T> Default for FromValueVisitor<T>

Source§

fn default() -> Self

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

impl<T: FromValue> ValueVisitor for FromValueVisitor<T>

Source§

type Output = T

The type produced by this visitor.
Source§

fn expecting(&self) -> &'static str

Description of what this visitor expects (for error messages).
Source§

fn visit_null(&mut self) -> Result<Self::Output>

Visit a null value.
Source§

fn visit_bool(&mut self, v: bool) -> Result<Self::Output>

Visit a boolean value.
Source§

fn visit_i64(&mut self, v: i64) -> Result<Self::Output>

Visit a signed integer value.
Source§

fn visit_f64(&mut self, v: f64) -> Result<Self::Output>

Visit a floating-point value.
Source§

fn visit_str(&mut self, v: &str) -> Result<Self::Output>

Visit a string value.
Source§

fn visit_array(&mut self, arr: &[ConfigValue]) -> Result<Self::Output>

Visit an array value.
Source§

fn visit_map(&mut self, map: MapAccess<'_>) -> Result<Self::Output>

Visit an object/map value.
Source§

fn visit_seq(&mut self, seq: SeqAccess<'_>) -> Result<Self::Output>

Visit an array value with sequential access. Read more
Source§

fn visit_enum( &mut self, _variant: &str, _value: &ConfigValue, ) -> Result<Self::Output>

Visit an enum variant. Read more
Source§

fn visit_unknown(&mut self, _key: &str, _value: &ConfigValue) -> Result<()>

Handle an unknown field during deserialization. Read more
Source§

fn finish(&mut self, output: Self::Output) -> Result<Self::Output>

Finish visiting and potentially transform the output. 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>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.