use crate::{
nameable,
protocol::{ControlFlowFor, Effect, SyncEffect, Walker},
};
/// Protocol for requesting a hint from a visitor.
pub trait RequestHint<'ctx, E: Effect = SyncEffect> {
/// Call this to request a hint.
///
/// `walker` is what the visitor (`self`) will call to give a hint using the
/// [`Hint`][crate::builtins::walker::Hint] protocol.
fn request_hint<'a>(&'a mut self, walker: &'a mut Walker<'a, 'ctx>) -> ControlFlowFor<'a, E>;
}
nameable! {
pub struct Name['a, 'ctx, E];
impl [E] for dyn RequestHint<'ctx, E> + 'a where {
E: Effect + 'static,
'ctx: 'a
}
}