Skip to main content

Accumulate

Trait Accumulate 

Source
pub trait Accumulate<T>: Default {
    // Required method
    fn try_done(self, field: &'static str) -> Result<T, Error>;
}
Expand description

Accumulate values during deserialization

A type implementing Accumulate<T> is used to accumulate a value of type T.

Required Methods§

Source

fn try_done(self, field: &'static str) -> Result<T, Error>

Convert the accumulator into the final value, or return an error

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<'a, T> Accumulate<Cow<'a, [T]>> for Vec<T>
where [T]: ToOwned<Owned = Vec<T>>,

Source§

fn try_done(self, _: &'static str) -> Result<Cow<'a, [T]>, Error>

Source§

impl<T> Accumulate<Option<T>> for Option<T>

Source§

fn try_done(self, _: &'static str) -> Result<Option<T>, Error>

Source§

impl<T> Accumulate<Vec<T>> for Vec<T>

Source§

fn try_done(self, _: &'static str) -> Result<Vec<T>, Error>

Source§

impl<T> Accumulate<T> for Option<T>

Source§

fn try_done(self, field: &'static str) -> Result<T, Error>

Implementors§