PathSink

Struct PathSink 

Source
pub struct PathSink<'a> { /* private fields */ }
Expand description

A path sink tracks the current path during deserialization.

Implementations§

Source§

impl<'a> PathSink<'a>

Source

pub fn wrap(sink: &'a mut dyn Sink) -> PathSink<'a>

Wraps a sink.

Source

pub fn wrap_ref(sink: SinkHandle<'a>) -> PathSink<'a>

Wraps a sink ref.

Trait Implementations§

Source§

impl<'a> Sink for PathSink<'a>

Source§

fn atom( &mut self, atom: Atom<'_>, state: &DeserializerState<'_>, ) -> Result<(), Error>

Receives an Atom. Read more
Source§

fn map(&mut self, state: &DeserializerState<'_>) -> Result<(), Error>

Begins the deserialization of a map. Read more
Source§

fn seq(&mut self, state: &DeserializerState<'_>) -> Result<(), Error>

Begins the receiving process for sequences. Read more
Source§

fn next_key( &mut self, state: &DeserializerState<'_>, ) -> Result<SinkHandle<'_>, Error>

Returns a sink for the next key in a map.
Source§

fn next_value( &mut self, state: &DeserializerState<'_>, ) -> Result<SinkHandle<'_>, Error>

Returns a sink for the next value in a map or sequence.
Source§

fn finish(&mut self, state: &DeserializerState<'_>) -> Result<(), Error>

Called after atom, map or `seq. Read more
Source§

fn descriptor(&self) -> &dyn Descriptor

Returns a descriptor for this type.
Source§

fn expecting(&self) -> Cow<'_, str>

Utility method to return an expectation message that is used in error messages. Read more
Source§

fn unexpected_atom( &mut self, atom: Atom<'_>, state: &DeserializerState<'_>, ) -> Result<(), Error>

Implements a default fallback handling for atoms.
Source§

fn value_for_key( &mut self, key: &str, state: &DeserializerState<'_>, ) -> Result<Option<SinkHandle<'_>>, Error>

Returns a value sink for a specific struct field. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for PathSink<'a>

§

impl<'a> !RefUnwindSafe for PathSink<'a>

§

impl<'a> !Send for PathSink<'a>

§

impl<'a> !Sync for PathSink<'a>

§

impl<'a> Unpin for PathSink<'a>

§

impl<'a> !UnwindSafe for PathSink<'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 = 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.