[][src]Trait serde_reflection::FormatHolder

pub trait FormatHolder {
    fn visit<'a>(
        &'a self,
        f: &mut dyn FnMut(&'a Format) -> Result<()>
    ) -> Result<()>;
fn visit_mut(
        &mut self,
        f: &mut dyn FnMut(&mut Format) -> Result<()>
    ) -> Result<()>;
fn unify(&mut self, other: Self) -> Result<()>; fn normalize(&mut self) -> Result<()> { ... } }

Required methods

fn visit<'a>(
    &'a self,
    f: &mut dyn FnMut(&'a Format) -> Result<()>
) -> Result<()>

Visit all the formats in self in a depth-first way.

fn visit_mut(
    &mut self,
    f: &mut dyn FnMut(&mut Format) -> Result<()>
) -> Result<()>

Mutably visit all the formats in self in a depth-first way.

fn unify(&mut self, other: Self) -> Result<()>

Update self in order to match other. The changes consist in replacing Unknown formats and adding missing variants wherever necessary. This can be seen as form of a first-order term-unification algorithm.

Loading content...

Provided methods

fn normalize(&mut self) -> Result<()>

Finalize the formats within self by making sure they contain no Unknown formats and that all eligible tuples are compressed into a TupleArray.

Loading content...

Implementors

impl FormatHolder for ContainerFormat[src]

impl FormatHolder for Format[src]

fn unify(&mut self, format: Format) -> Result<()>[src]

Unify the newly "traced" value format into the current format. Note that there should be no TupleArrays at this point.

impl FormatHolder for VariantFormat[src]

impl<T> FormatHolder for Named<T> where
    T: FormatHolder + Debug
[src]

Loading content...