Diffstat (limited to 'src/protocol/visitor/sequence.rs')
-rw-r--r--src/protocol/visitor/sequence.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/protocol/visitor/sequence.rs b/src/protocol/visitor/sequence.rs
index ef0c5e9..f367ae2 100644
--- a/src/protocol/visitor/sequence.rs
+++ b/src/protocol/visitor/sequence.rs
@@ -1,6 +1,6 @@
use crate::{
any::TypeName,
- effect::{Effect, Future},
+ effect::{Effect, ObjSafe},
higher_ranked_type,
hkt::Marker,
protocol::{
@@ -20,7 +20,7 @@ pub trait Sequence<'ctx, E: Effect> {
fn visit<'a>(
&'a mut self,
scope: DynSequenceScope<'a, 'ctx, E>,
- ) -> Future<'a, VisitResult<DynSequenceScope<'a, 'ctx, E>>, E>;
+ ) -> ObjSafe<'a, VisitResult<DynSequenceScope<'a, 'ctx, E>>, E>;
}
pub struct SequenceProto<E: Effect>(Marker<E>);
@@ -42,9 +42,9 @@ higher_ranked_type! {
}
pub trait SequenceScope<'ctx, E: Effect> {
- fn size_hint(&mut self) -> Future<'_, (usize, Option<usize>), E>;
+ fn size_hint(&mut self) -> ObjSafe<'_, (usize, Option<usize>), E>;
- fn next<'a>(&'a mut self, visitor: DynVisitor<'a, 'ctx>) -> Future<'a, Flow, E>;
+ fn next<'a>(&'a mut self, visitor: DynVisitor<'a, 'ctx>) -> ObjSafe<'a, Flow, E>;
}
pub type DynSequenceScope<'a, 'ctx, E> = &'a mut (dyn SequenceScope<'ctx, E> + Send + Sync + 'a);
@@ -89,12 +89,12 @@ impl<E: Effect> HintMeta for SequenceProto<E> {
pub fn visit_sequence<'a, 'ctx, E: Effect>(
visitor: DynVisitor<'a, 'ctx>,
scope: DynSequenceScope<'a, 'ctx, E>,
-) -> Future<'a, VisitResult<DynSequenceScope<'a, 'ctx, E>>, E> {
+) -> ObjSafe<'a, VisitResult<DynSequenceScope<'a, 'ctx, E>>, E> {
if let Some(object) = visitor.0.upcast_mut::<SequenceProto<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.
- E::ready(VisitResult::Skipped(scope))
+ E::ready(VisitResult::Skipped(scope)).into()
}
}