Diffstat (limited to 'src/effect/async/map.rs')
| -rw-r--r-- | src/effect/async/map.rs | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/src/effect/async/map.rs b/src/effect/async/map.rs index d8c1331..45bee06 100644 --- a/src/effect/async/map.rs +++ b/src/effect/async/map.rs @@ -7,7 +7,7 @@ use core::{ use futures::Future; use pin_project::pin_project; -use crate::effect::{Effective, ErasedEffective}; +use crate::effect::{Effective, ErasedEffective, Ss}; use super::{Async, BoxOrReady, Then}; @@ -64,8 +64,7 @@ where } } -impl<'c, 'lt: 'c, Fut0: Send + Sync + 'lt, F0: Send + Sync + 'c, R0: Send + Sync + 'c> Effective<'c> - for Map<Fut0, F0> +impl<'c, 'lt: 'c, Fut0: Ss + 'lt, F0: Ss + 'c, R0: Ss + 'c> Effective<'c> for Map<Fut0, F0> where F0: FnOnce(Fut0::Output) -> R0, Fut0: Future, @@ -85,15 +84,22 @@ where self } - type Loop<'ctx: 'a, 'a, T: Send + Sync + 'a, F: Send + Sync + 'a> + type Loop<'ctx: 'a, 'a, T: Ss + 'a, F: Ss + 'a> = BoxOrReady<'a, (R0, T)> where F: for<'b> FnMut(&'b mut Self::Output) -> ErasedEffective<'b, ControlFlow<T>, Self::Effect, (&'b mut Self::Output, &'ctx ())>, 'c: 'a; - fn r#loop<'ctx: 'a, 'a, T: Send + Sync + 'a, F: Send + Sync + 'a>(self, mut cb: F) -> Self::Loop<'ctx, 'a, T, F> + fn r#loop<'ctx: 'a, 'a, T: Ss + 'a, F: Ss + 'a>(self, mut cb: F) -> Self::Loop<'ctx, 'a, T, F> where - F: for<'b> FnMut(&'b mut Self::Output) -> ErasedEffective<'b, ControlFlow<T>, Self::Effect, (&'b mut Self::Output, &'ctx ())>, + F: for<'b> FnMut( + &'b mut Self::Output, + ) -> ErasedEffective< + 'b, + ControlFlow<T>, + Self::Effect, + (&'b mut Self::Output, &'ctx ()), + >, 'c: 'a, { BoxOrReady::Boxed(Box::pin(async move { @@ -107,13 +113,13 @@ where })) } - type Map<'a, T: Send + Sync + 'a, F: Send + Sync + 'a> = + type Map<'a, T: Ss + 'a, F: Ss + 'a> = Map<Self, F> where F: FnOnce(Self::Output) -> T, 'c: 'a; - fn map<'a, T: Send + Sync + 'a, F: Send + Sync + 'a>(self, cb: F) -> Self::Map<'a, T, F> + fn map<'a, T: Ss + 'a, F: Ss + 'a>(self, cb: F) -> Self::Map<'a, T, F> where F: FnOnce(Self::Output) -> T, 'c: 'a, @@ -121,17 +127,14 @@ where Map::new(self, cb) } - type Then<'a, T: Send + Sync + 'a, V: Send + Sync + 'a, F: Send + Sync + 'a> + type Then<'a, T: Ss + 'a, V: Ss + 'a, F: Ss + 'a> = Then<'a, Self, F, V> where F: FnOnce(Self::Output) -> V, V: Effective<'a, Output = T, Effect = Self::Effect>, 'c: 'a; - fn then<'a, T: Send + Sync + 'a, V: Send + Sync + 'a, F: Send + Sync + 'a>( - self, - cb: F, - ) -> Self::Then<'a, T, V, F> + fn then<'a, T: Ss + 'a, V: Ss + 'a, F: Ss + 'a>(self, cb: F) -> Self::Then<'a, T, V, F> where F: FnOnce(Self::Output) -> V, V: Effective<'a, Output = T, Effect = Self::Effect>, @@ -140,13 +143,13 @@ where Then::new(self, cb) } - type AsCtx<'ctx: 'a, 'a, T: Send + Sync + 'a, F: Send + Sync + 'a> + type AsCtx<'ctx: 'a, 'a, T: Ss + 'a, F: Ss + 'a> = BoxOrReady<'a, (Self::Output, T)> where F: for<'b> FnOnce(&'b mut Self::Output) -> ErasedEffective<'b, T, Self::Effect>, 'c: 'a; - fn as_ctx<'ctx: 'a, 'a, T: Send + Sync + 'a, F: Send + Sync + 'a>(self, cb: F) -> Self::AsCtx<'ctx, 'a, T, F> + fn as_ctx<'ctx: 'a, 'a, T: Ss + 'a, F: Ss + 'a>(self, cb: F) -> Self::AsCtx<'ctx, 'a, T, F> where F: for<'b> FnOnce(&'b mut Self::Output) -> ErasedEffective<'b, T, Self::Effect>, 'c: 'a, |