1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use core::ops::ControlFlow;

use crate::{nameable, protocol::Walker};

/// Protocol for requesting a hint from a visitor.
pub trait RequestHint<'ctx> {
    /// 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(&mut self, walker: Walker<'_, 'ctx>) -> ControlFlow<()>;
}

nameable! {
    pub struct Name['a, 'ctx];
    impl for dyn RequestHint<'ctx> + 'a where {'ctx: 'a}
}