Diffstat (limited to 'src/protocol/visitor/recoverable.rs')
| -rw-r--r-- | src/protocol/visitor/recoverable.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/protocol/visitor/recoverable.rs b/src/protocol/visitor/recoverable.rs index ce7a181..b43344f 100644 --- a/src/protocol/visitor/recoverable.rs +++ b/src/protocol/visitor/recoverable.rs @@ -3,7 +3,7 @@ use crate::{ effect::{Effect, ErasedEffective, ReadyExt as _}, hkt::Marker, protocol::{ - walker::hint::{HintMeta, Meta}, + walker::hint::{HasProtocol, HintMeta, Meta}, DynVisitor, }, Status, @@ -15,7 +15,7 @@ pub trait Recoverable<'ctx, E: Effect> { fn visit<'a>( &'a mut self, scope: DynRecoverableScope<'a, 'ctx, E>, - ) -> ErasedEffective<'a, VisitResult<DynRecoverableScope<'a, 'ctx, E>>, E>; + ) -> ErasedEffective<'a, VisitResult, E>; } pub struct RecoverableProto<E: Effect>(Marker<E>); @@ -66,12 +66,14 @@ impl<E: Effect> HintMeta for RecoverableProto<E> { pub fn visit_recoverable<'a, 'ctx, E: Effect>( visitor: DynVisitor<'a, 'ctx>, scope: DynRecoverableScope<'a, 'ctx, E>, -) -> ErasedEffective<'a, VisitResult<DynRecoverableScope<'a, 'ctx, E>>, E> { +) -> ErasedEffective<'a, VisitResult, 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 { // If the visitor doesn't support request hint then we continue. - VisitResult::Skipped(scope).ready() + VisitResult::Skipped(()).ready() } } + +impl<'ctx, T, E: Effect> HasProtocol<RecoverableProto<E>> for T where T: Recoverable<'ctx, E> {} |