use crate::{
any_trait,
effect::{Effect, Effective, EffectiveExt, ErasedEffective},
protocol::{visitor::VisitResult, DynVisitor},
DynWalkerObjSafe,
};
// pub mod array;
pub mod bool;
// pub mod option;
// pub mod variant;
pub mod r#struct;
pub mod tag_name;
#[derive(Default)]
#[non_exhaustive]
pub struct NoopVisitor;
impl NoopVisitor {
pub fn new() -> Self {
Self
}
}
any_trait! {
impl['ctx] NoopVisitor = []
}
impl NoopVisitor {
pub fn walk_dyn<'ctx: 'e, 'walker: 'e, 'e, E: Effect>(
walker: DynWalkerObjSafe<'walker, 'ctx, E>,
) -> ErasedEffective<'e, VisitResult<DynWalkerObjSafe<'walker, 'ctx, E>>, E> {
E::ready(NoopVisitor::new()).as_ctx_map(|noop| {
walker
.walk(DynVisitor(noop))
.map(|x| x.to_continue().into())
.cast()
})
}
}