Diffstat (limited to 'src/build.rs')
| -rw-r--r-- | src/build.rs | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/build.rs b/src/build.rs index 2cd87ea..16e1f95 100644 --- a/src/build.rs +++ b/src/build.rs @@ -3,11 +3,20 @@ pub mod builders; use effectful::environment::{DynBind, EnvConfig, Environment, NativeForm}; -use crate::protocol::{AsVisitor, DynVisitor}; +use crate::protocol::AsVisitor; -/// A buildable type. +/// The canonical builders for a type. +/// +/// This trait associates a set of builders with the type. +/// This trait is mainly used by the derive macros to automatically select a builder +/// for a field or variant. +/// +/// There can be one canonical builder per mode. The mode is specified by the `M` generic and +/// can be any type. It is only used as a type level tag. pub trait Build<'ctx, M, E: Environment>: Sized { - /// The builder that can be used to build a value of `Self`. + /// The canonical builder for mode `M`. + /// + /// This builder will build values of type `Self`. type Builder: Builder<'ctx, E, Value = Self>; } |