pub trait AssocVisitor: Sized + Sealed {
    type Result;

    fn visit_entry<K: Display, V: Display>(
        &mut self,
        key: K,
        value: V
    ) -> ControlFlow<Self::Result>; fn finish(self) -> Self::Result; fn visit_entries_and_finish<K, V, I>(self, entries: I) -> Self::Result
   where
        K: Display,
        V: Display,
        I: IntoIterator<Item = (K, V)>
, { ... } }
Expand description

Associative array visitor.

See the module documentation for usage.

Required Associated Types

Result of the visit.

Required Methods

source

fn visit_entry<K: Display, V: Display>(
    &mut self,
    key: K,
    value: V
) -> ControlFlow<Self::Result>

Visits an entry.

If this returned ControlFlow::Break(v), Context::visit should also return this v.

To feed multiple items at once, do entries.into_iter().try_for_each(|(key, value)| self.visit_entry(key, value)) for example.

Finishes visiting the associative array.

Provided Methods

Visits entries and finish.

Implementors