Diffstat (limited to 'src/protocol/visitor.rs')
-rw-r--r--src/protocol/visitor.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/protocol/visitor.rs b/src/protocol/visitor.rs
index e414b4c..0189dc1 100644
--- a/src/protocol/visitor.rs
+++ b/src/protocol/visitor.rs
@@ -1,7 +1,6 @@
use core::ops::ControlFlow;
use crate::{
- effect::{Effective, ErasedEffective, Ss},
never::Never,
Flow, Status,
};
@@ -12,6 +11,7 @@ mod sequence;
mod tag;
mod value;
+use effectful::{effective::Effective, environment::{DynBind, NativeForm}, forward_send_sync};
pub use recoverable::*;
pub use request_hint::*;
pub use sequence::*;
@@ -31,6 +31,8 @@ pub enum VisitResult<S = ()> {
Control(Flow),
}
+forward_send_sync!({S} {} VisitResult<S>);
+
impl<S> VisitResult<S> {
pub fn unit_skipped(self) -> VisitResult<()> {
match self {
@@ -95,16 +97,15 @@ pub trait EffectiveVisitExt<'lt>: Effective<'lt> {
fn if_skipped<'ctx, 'wrap, Ctx, F>(
self,
f: F,
- ) -> ErasedEffective<'wrap, (Ctx, VisitResult<()>), Self::Effect>
+ ) -> NativeForm<'wrap, (Ctx, VisitResult<()>), Self::Env>
where
+ Ctx: DynBind<Self::Env>,
Self: Effective<'lt, Output = (Ctx, VisitResult<()>)>,
F: 'wrap
- + Ss
+ for<'temp> FnOnce(
&'temp mut Ctx,
)
- -> ErasedEffective<'temp, VisitResult<()>, Self::Effect, &'ctx ()>,
- Ctx: Ss,
+ -> NativeForm<'temp, VisitResult<()>, Self::Env, &'ctx ()>,
'ctx: 'lt,
'lt: 'wrap,
{
@@ -129,17 +130,16 @@ pub trait EffectiveVisitExt<'lt>: Effective<'lt> {
fn if_not_finished<'ctx, 'wrap, Ctx, F>(
self,
f: F,
- ) -> ErasedEffective<'wrap, (Ctx, VisitResult<()>), Self::Effect>
+ ) -> NativeForm<'wrap, (Ctx, VisitResult<()>), Self::Env>
where
+ Ctx: DynBind<Self::Env>,
Self: Effective<'lt, Output = (Ctx, VisitResult<()>)>,
F: 'wrap
+ for<'temp> FnOnce(
&'temp mut Ctx,
)
- -> ErasedEffective<'temp, VisitResult<()>, Self::Effect, &'ctx ()>,
+ -> NativeForm<'temp, VisitResult<()>, Self::Env, &'ctx ()>,
'ctx: 'lt,
- Ctx: Ss,
- F: Ss,
'lt: 'wrap,
{
self.r#do(