Trait ListVisitor
trait ListVisitor: Sized + private::Sealed
List visitor.
See [the module documentation][self] for usage.
Associated Types
type ResultResult of the visit.
Required Methods
fn visit_item<T: fmt::Display>(self: &mut Self, item: T) -> ControlFlow<<Self as >::Result>Visits an item.
If this returned
ControlFlow::Break(v),Context::visitshould also return thisv.To feed multiple items at once, do
items.into_iter().try_for_each(|item| self.visit_item(item))for example.fn finish(self: Self) -> <Self as >::ResultFinishes visiting the list.
Provided Methods
fn visit_items_and_finish<T, I>(self: Self, items: I) -> <Self as >::Result where T: Display, I: IntoIterator<Item = T>Visits items and finish.