Diffstat (limited to 'src/build.rs')
| -rw-r--r-- | src/build.rs | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/src/build.rs b/src/build.rs index 5a6b526..24232a0 100644 --- a/src/build.rs +++ b/src/build.rs @@ -6,15 +6,9 @@ use crate::{ }; /// A buildable type. -pub trait Build<'ctx>: BuilderTypes<Value = Self> + Send { +pub trait Build<'ctx, M, E: Effect<'ctx>>: BuilderTypes<Value = Self> + Send { /// The builder that can be used to build a value of `Self`. - type Builder<E: Effect<'ctx>>: Builder< - 'ctx, - Seed = Self::Seed, - Error = Self::Error, - Value = Self, - Effect = E, - >; + type Builder: Builder<'ctx, E, Seed = Self::Seed, Error = Self::Error, Value = Self>; } pub trait BuilderTypes { @@ -40,10 +34,8 @@ pub trait BuilderTypes { /// the builder with data from it's walk. /// - Call [`Self::build()`] to finish building the value and get any errors /// that happened during filling it with data. -pub trait Builder<'ctx>: BuilderTypes + Sized + Send { - type Effect: Effect<'ctx>; - - fn from_seed<'a>(seed: Self::Seed) -> Future<'a, 'ctx, Self, Self::Effect> +pub trait Builder<'ctx, E: Effect<'ctx>>: BuilderTypes + Sized + Send { + fn from_seed<'a>(seed: Self::Seed) -> Future<'a, 'ctx, Self, E> where Self: 'a; @@ -51,7 +43,7 @@ pub trait Builder<'ctx>: BuilderTypes + Sized + Send { /// /// If an error happened with the builder during the walk /// it will be reported here. - fn build<'a>(self) -> Future<'a, 'ctx, Result<Self::Value, Self::Error>, Self::Effect> + fn build<'a>(self) -> Future<'a, 'ctx, Result<Self::Value, Self::Error>, E> where Self: 'a; |