Skip to main content

ChoiceSlot

Struct ChoiceSlot 

Source
pub struct ChoiceSlot<'a> {
    pub suffix: Option<&'static str>,
    pub value: Option<&'a Value>,
    pub element: Option<&'a Value>,
}
Expand description

The parts of one choice element met while reading an object.

Fields§

§suffix: Option<&'static str>

The type suffix of the key seen, for example String for valueString.

§value: Option<&'a Value>

The value part.

§element: Option<&'a Value>

The _name part.

Implementations§

Source§

impl<'a> ChoiceSlot<'a>

Source

pub fn value( &mut self, suffix: &'static str, value: &'a Value, path: &Path, ) -> Result<(), DecodeError>

Records the value part of the form suffix.

§Errors

Returns DecodeError when another form was already seen.

Source

pub fn element( &mut self, suffix: &'static str, element: &'a Value, path: &Path, ) -> Result<(), DecodeError>

Records the _name part of the form suffix.

§Errors

Returns DecodeError when another form was already seen.

Trait Implementations§

Source§

impl<'a> Debug for ChoiceSlot<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Default for ChoiceSlot<'a>

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl<'a> Freeze for ChoiceSlot<'a>

§

impl<'a> RefUnwindSafe for ChoiceSlot<'a>

§

impl<'a> Send for ChoiceSlot<'a>

§

impl<'a> Sync for ChoiceSlot<'a>

§

impl<'a> Unpin for ChoiceSlot<'a>

§

impl<'a> UnsafeUnpin for ChoiceSlot<'a>

§

impl<'a> UnwindSafe for ChoiceSlot<'a>

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.