pub struct Construction {
pub at: Option<Path>,
pub entry: Ident,
pub finish: Option<Ident>,
pub fallible: bool,
pub blanket: Vec<Blanket>,
pub calls: Vec<Injection>,
}Expand description
What a declaration says about the way its wrapped type is BUILT.
Every field defaults to the shape the emission had before the vocabulary existed, which is what
makes the words free: a declaration that writes no builder(…) carries this value, and the
writer turns it into the same tokens the hand-written version emitted.
Fields§
§at: Option<Path>The builder(…) word’s own path, or None where the declaration wrote none.
Kept for the SPAN, exactly as RecordModel::asynchronous keeps
one: the refusal a construction word earns on a declaration that wraps nothing has to blame
the word, and a defaulted value has no token for a caret to land on. It is also the one
reliable answer to was anything written — every other field has a meaningful default.
entry: IdentThe FIRST call — Remote::<entry>(…).
new unless entry = "…" named another, which is the house rule stated as a default rather
than assumed: a type that keeps the options family has a new, and one that spells its
constructor from_ratio says so in one word instead of taking the whole-body escape.
finish: Option<Ident>The LAST call — .<finish>(…) — or None where the entry hands back the value itself.
Its presence is what makes this a BUILDER protocol rather than a constructor. Without it
the entry’s return value IS the remote and every link is a consuming with_… on the remote
itself; with it the entry opens a builder, the links refine the builder, and this call closes
it. One word decides between the two, because one word is the whole difference.
fallible: boolfallible — the TERMINAL step hands back a Result, and the raise carries its Err.
§The terminal step, which is the finish where there is one and the entry otherwise
The word is read at the step that YIELDS THE VALUE, and the reading is forced by what is
useful rather than chosen for symmetry: the shape that exists in the wild is an infallible
opening (Remote::builder()) closed by a validating build(), and a word that demanded both
halves be fallible could not describe it at all. A protocol whose ENTRY is the fallible half
writes no finish, and the same word reaches it.
What the Err joins is the road the raise already has: <db>(try_into(error = "…"))
types the row’s TryFrom where a declaration named a type, and the boxed
dyn Error + Send + Sync is what it is otherwise — so the ? written here converts through
the same From every fallible column conversion already converts through.
blanket: Vec<Blanket>on(Type, into) — the BLANKET, one entry per rule, in the order they were written.
A rule keyed by the field’s declared TYPE rather than by its name, which is bon’s own shape
and deliberately so: a remote whose builder was generated with #[builder(on(String, into))]
has one fact to restate, and restating it per field is how a manifest and its upstream drift.
calls: Vec<Injection>call(with = "…", value = "…") — the links NO column feeds, in the order they were written.
The seat for a constructor argument that is not a column of this record: a unit the upstream demands and the row does not store, a mode word, a capacity hint. Repeatable, because a protocol may want several and each is one independent fact.
Implementations§
Source§impl Construction
impl Construction
Sourcepub fn blankets(&self, ty: &Type) -> bool
pub fn blankets(&self, ty: &Type) -> bool
Whether this field’s declared TYPE is claimed by a blanket rule.
Compared as TOKENS, which is the only comparison available: a macro holds spellings and
syn::Type has no semantic equality — u32 and a type Width = u32 are the same type to the
compiler and two different tokens here. The rule is stated in the declaration’s own spelling
and matched against the declaration’s own spelling, so the two agree by construction, and a
blanket that names an alias the fields do not use simply claims nothing.
Sourcepub fn call(&self, host: &Path, supplied: &[Supplied]) -> TokenStream
pub fn call(&self, host: &Path, supplied: &[Supplied]) -> TokenStream
THE CALL — the whole expression that yields the built value.
host is the type the entry is called on. supplied is one entry per value, IN THE ORDER
THE DECLARATION WROTE THEM, which is the one order an author can see and therefore the one
order a positional argument list may be gathered in.
§Two shapes, and the second is only reached when it has to be
A CHAIN is what a protocol is: Remote::new(a, b).with_c(c).build(). It is also not an
attribute position — .with_a(…) #[cfg(…)] .with_b(…) is not Rust — and it has no place to
put a &mut setter’s statement. So a protocol carrying a GATED link or a SETTER is unrolled
into a block binding, and one carrying neither stays the chain it always was, token for token.