Diffstat (limited to 'src/protocol/visitor/recoverable.rs')
| -rw-r--r-- | src/protocol/visitor/recoverable.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/protocol/visitor/recoverable.rs b/src/protocol/visitor/recoverable.rs index 4c9c604..b0d14de 100644 --- a/src/protocol/visitor/recoverable.rs +++ b/src/protocol/visitor/recoverable.rs @@ -4,8 +4,8 @@ use crate::{ higher_ranked_type, hkt::Marker, protocol::{ - walker::hint::{HintKnown, HintMeta}, - Visitor, + walker::hint::{HintMeta, Meta}, + DynVisitor, }, Status, }; @@ -38,7 +38,7 @@ higher_ranked_type! { } pub trait RecoverableScope<'ctx, E: Effect> { - fn new_walk<'a>(&'a mut self, visitor: Visitor<'a, 'ctx>) -> Future<'a, Status, E>; + fn new_walk<'a>(&'a mut self, visitor: DynVisitor<'a, 'ctx>) -> Future<'a, Status, E>; } pub type DynRecoverableScope<'a, 'ctx, E> = @@ -47,7 +47,7 @@ pub type DynRecoverableScope<'a, 'ctx, E> = pub struct RecoverableKnown; higher_ranked_type! { - impl HintKnown { + impl Meta { impl['a, 'ctx] type T['a, 'ctx] for RecoverableKnown = RecoverableKnown; @@ -60,13 +60,15 @@ impl<E: Effect> HintMeta for RecoverableProto<E> { type Known = RecoverableKnown; type Hint = (); + + type Effect = E; } pub fn visit_recoverable<'a, 'ctx, E: Effect>( - visitor: Visitor<'a, 'ctx>, + visitor: DynVisitor<'a, 'ctx>, scope: DynRecoverableScope<'a, 'ctx, E>, ) -> Future<'a, VisitResult<DynRecoverableScope<'a, 'ctx, E>>, E> { - if let Some(object) = visitor.upcast_mut::<RecoverableProto<E>>() { + if let Some(object) = visitor.0.upcast_mut::<RecoverableProto<E>>() { // Allow the visitor to give a hint if it wants. object.visit(scope) } else { |