Diffstat (limited to 'src/protocol/visitor/sequence.rs')
-rw-r--r--src/protocol/visitor/sequence.rs22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/protocol/visitor/sequence.rs b/src/protocol/visitor/sequence.rs
index 32deb9c..afa6f9c 100644
--- a/src/protocol/visitor/sequence.rs
+++ b/src/protocol/visitor/sequence.rs
@@ -1,5 +1,13 @@
use crate::{
- any::{TypeName}, effect::{Effect, Future}, higher_ranked_type, hkt::Marker, protocol::{walker::hint::{HintKnown, HintMeta}, Visitor}, Flow
+ any::TypeName,
+ effect::{Effect, Future},
+ higher_ranked_type,
+ hkt::Marker,
+ protocol::{
+ walker::hint::{HintKnown, HintMeta},
+ Visitor,
+ },
+ Flow,
};
use super::VisitResult;
@@ -16,12 +24,12 @@ pub struct SequenceProto<E: Effect>(Marker<E>);
higher_ranked_type! {
impl TypeName {
impl['a, 'ctx, E] type T['a, 'ctx] for SequenceProto<E> =
- dyn Sequence<'ctx, E> + Send + 'a
+ dyn Sequence<'ctx, E> + Send + Sync + 'a
where {
E: Effect
};
- impl['a, 'ctx, E] type HigherRanked['a, 'ctx] for dyn Sequence<'ctx, E> + Send + 'a =
+ impl['a, 'ctx, E] type HigherRanked['a, 'ctx] for dyn Sequence<'ctx, E> + Send + Sync + 'a =
SequenceProto<E>
where {
E: Effect
@@ -35,14 +43,14 @@ pub trait SequenceScope<'ctx, E: Effect> {
fn next<'a>(&'a mut self, visitor: Visitor<'a, 'ctx>) -> Future<'a, Flow, E>;
}
-pub type DynSequenceScope<'a, 'ctx, E> = &'a mut (dyn SequenceScope<'ctx, E> + Send + 'a);
+pub type DynSequenceScope<'a, 'ctx, E> = &'a mut (dyn SequenceScope<'ctx, E> + Send + Sync + 'a);
higher_ranked_type! {
impl HintKnown {
- impl['a] type T['a] for SequenceKnown =
+ impl['a, 'ctx] type T['a, 'ctx] for SequenceKnown =
SequenceKnown;
- impl['a] type HigherRanked['a] for SequenceKnown =
+ impl['a, 'ctx] type HigherRanked['a, 'ctx] for SequenceKnown =
SequenceKnown;
}
}
@@ -56,7 +64,7 @@ pub struct SequenceHint {
pub len: (usize, Option<usize>),
}
-impl<'ctx, E: Effect> HintMeta<'ctx> for SequenceProto<E> {
+impl<E: Effect> HintMeta for SequenceProto<E> {
type Known = SequenceKnown;
type Hint = SequenceHint;