Diffstat (limited to 'src/walk.rs')
-rw-r--r--src/walk.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/walk.rs b/src/walk.rs
index fa8ec4b..384760a 100644
--- a/src/walk.rs
+++ b/src/walk.rs
@@ -1,6 +1,6 @@
pub mod walkers;
-use crate::protocol::{ControlFlowFor, Effect, Visitor};
+use crate::protocol::{Effect, EffectAnyTrait, Visitor, Yield};
/// A type that can be walked.
pub trait Walk<'ctx>: Sized {
@@ -22,7 +22,7 @@ pub fn into_walker<'ctx, T: Walk<'ctx>>(value: T) -> T::Walker {
/// - Call [Self::walk()] to walk the value. Data will be sent to the provided
/// visitor.
pub trait Walker<'ctx> {
- type Effect: Effect<'ctx, Self::Output, Self::Error> + Effect<'ctx>;
+ type Effect: Effect<'ctx, Result<Self::Output, Self::Error>>;
type Error;
@@ -38,5 +38,8 @@ pub trait Walker<'ctx> {
fn walk<'a>(
self,
visitor: Visitor<'a, 'ctx, Self::Effect>,
- ) -> ControlFlowFor<'a, 'ctx, Self::Effect, Self::Output, Self::Error> where Self: 'a, 'ctx: 'a;
+ ) -> Yield<'a, 'ctx, Result<Self::Output, Self::Error>, Self::Effect>
+ where
+ Self: 'a,
+ 'ctx: 'a;
}