Diffstat (limited to 'src/protocol/visitor/request_hint.rs')
-rw-r--r--src/protocol/visitor/request_hint.rs18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/protocol/visitor/request_hint.rs b/src/protocol/visitor/request_hint.rs
index 179a68a..87c073d 100644
--- a/src/protocol/visitor/request_hint.rs
+++ b/src/protocol/visitor/request_hint.rs
@@ -1,17 +1,21 @@
-use core::ops::ControlFlow;
-
-use crate::{nameable, protocol::Walker};
+use crate::{
+ nameable,
+ protocol::{ControlFlowFor, Effect, SyncEffect, Walker},
+};
/// Protocol for requesting a hint from a visitor.
-pub trait RequestHint<'ctx> {
+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(&mut self, walker: Walker<'_, 'ctx>) -> ControlFlow<()>;
+ fn request_hint<'a>(&'a mut self, walker: &'a mut Walker<'ctx>) -> ControlFlowFor<'a, E>;
}
nameable! {
- pub struct Name['a, 'ctx];
- impl for dyn RequestHint<'ctx> + 'a where {'ctx: 'a}
+ pub struct Name['a, 'ctx, E];
+ impl [E] for dyn RequestHint<'ctx, E> + 'a where {
+ E: Effect + 'static,
+ 'ctx: 'a
+ }
}