Diffstat (limited to 'src/build.rs')
| -rw-r--r-- | src/build.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/build.rs b/src/build.rs index f4476f0..716b882 100644 --- a/src/build.rs +++ b/src/build.rs @@ -2,23 +2,23 @@ pub mod builders; use crate::{ effect::{Effect, Future}, - protocol::Visitor, + protocol::DynVisitor, }; /// A buildable type. -pub trait Build<'ctx, M, E: Effect>: BuilderTypes<Value = Self> + Send { +pub trait Build<'ctx, M, E: Effect>: BuilderTypes<Value = Self> + Send + Sync { /// The builder that can be used to build a value of `Self`. type Builder: Builder<'ctx, E, Seed = Self::Seed, Error = Self::Error, Value = Self>; } pub trait BuilderTypes { - type Seed: Send; + type Seed: Send + Sync; /// Error that can happen during filling the builder with data. - type Error: Send; + type Error: Send + Sync; /// Type to be built. - type Value: Send; + type Value: Send + Sync; } /// Builder for a type. @@ -34,7 +34,7 @@ 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, E: Effect>: BuilderTypes + Sized + Send { +pub trait Builder<'ctx, E: Effect>: BuilderTypes + Sized + Send + Sync { fn from_seed<'a>(seed: Self::Seed) -> Future<'a, Self, E> where Self: 'a; @@ -50,5 +50,5 @@ pub trait Builder<'ctx, E: Effect>: BuilderTypes + Sized + Send { /// Get the builder as a visitor that a walker can use. /// /// This is expected to just be `self`. - fn as_visitor(&mut self) -> Visitor<'_, 'ctx>; + fn as_visitor(&mut self) -> DynVisitor<'_, 'ctx>; } |