Diffstat (limited to 'src/protocol/visitor/recoverable.rs')
-rw-r--r--src/protocol/visitor/recoverable.rs32
1 files changed, 13 insertions, 19 deletions
diff --git a/src/protocol/visitor/recoverable.rs b/src/protocol/visitor/recoverable.rs
index a3a9d65..90c671b 100644
--- a/src/protocol/visitor/recoverable.rs
+++ b/src/protocol/visitor/recoverable.rs
@@ -1,20 +1,14 @@
use crate::{
- any::{TypeName, WithContextLt},
- bijective_higher_ranked_type,
- effect::{Effect, Future},
- higher_ranked_type,
- hkt::AnySend,
- protocol::{walker::hint::HintMeta, Visitor},
- Flow,
+ any::{TypeName, WithContextLt}, bijective_higher_ranked_type, effect::{Effect, Future}, hkt::AnySizedSend, protocol::{walker::hint::HintMeta, Visitor}, Flow
};
use super::Status;
-pub trait Recoverable<'ctx, E: Effect<'ctx>> {
+pub trait Recoverable<'ctx, E: Effect> {
fn visit<'a>(
&'a mut self,
scope: DynRecoverableScope<'a, 'ctx, E>,
- ) -> Future<'a, 'ctx, Flow, E>;
+ ) -> Future<'a, Flow, E>;
}
bijective_higher_ranked_type! {
@@ -22,7 +16,7 @@ bijective_higher_ranked_type! {
for<'a>
(dyn Recoverable<'ctx, E> + Send + 'a)
where {
- E: Effect<'ctx>
+ E: Effect
}
}
@@ -31,30 +25,30 @@ bijective_higher_ranked_type! {
for<'ctx>
(DynRecoverable<'ctx, E>)
where {
- E: Effect<'ctx>
+ E: Effect
}
}
-pub trait RecoverableScope<'ctx, E: Effect<'ctx>> {
- fn new_walk<'a>(&'a mut self, visitor: Visitor<'a, 'ctx>) -> Future<'a, 'ctx, Flow, E>;
+pub trait RecoverableScope<'ctx, E: Effect> {
+ fn new_walk<'a>(&'a mut self, visitor: Visitor<'a, 'ctx>) -> Future<'a, Flow, E>;
}
pub type DynRecoverableScope<'a, 'ctx, E> = &'a mut (dyn RecoverableScope<'ctx, E> + Send + 'a);
-higher_ranked_type! {
- pub type RecoverableKnownHkt['ctx]: (AnySend) = for<'lt> ()
+bijective_higher_ranked_type! {
+ pub type RecoverableKnownHkt[][]: AnySizedSend[][] for<'lt> (())
}
-impl<'ctx, E: Effect<'ctx>> HintMeta<'ctx> for DynRecoverable<'ctx, E> {
- type Known = RecoverableKnownHkt<'ctx>;
+impl<'ctx, E: Effect> HintMeta<'ctx> for DynRecoverable<'ctx, E> {
+ type Known = RecoverableKnownHkt;
type Hint = ();
}
-pub fn visit_recoverable<'a, 'ctx, E: Effect<'ctx>>(
+pub fn visit_recoverable<'a, 'ctx, E: Effect>(
visitor: Visitor<'a, 'ctx>,
scope: DynRecoverableScope<'a, 'ctx, E>,
-) -> Future<'a, 'ctx, Status, E> {
+) -> Future<'a, Status, E> {
if let Some(object) = visitor.upcast_mut::<DynRecoverable<'ctx, E>>() {
// Allow the visitor to give a hint if it wants.
E::map(object.visit(scope), |flow| match flow {