pub mod builders;
pub mod protocols;
use crate::protocol::Implementer;
/// A type buildable from a walker.
pub trait Build<'ctx>: Sized {
/// The builder that can be used to build a value.
type Builder: Builder<'ctx, Value = Self>;
}
/// Extension to [`Visitor`] that allows constructing and finishing the visitor.
pub trait Builder<'ctx>: Default {
type Error;
/// Type to be built.
type Value;
/// As a visitor.
fn as_visitor(&mut self) -> &mut dyn Implementer<'ctx>;
/// Finish the value.
fn build(self) -> Result<Self::Value, Self::Error>;
}