pub struct ConstructorBuilder { /* private fields */ }Expand description
Accumulates a constructor definition and installs it via def_constructor.
Implementations§
Source§impl ConstructorBuilder
impl ConstructorBuilder
Sourcepub fn new(proto: &str) -> Result<Self>
pub fn new(proto: &str) -> Result<Self>
Parse the prototype (shared with the macro path via parse_prototype).
Sourcepub fn replacement(self, repl: ReplacementClosure) -> Self
pub fn replacement(self, repl: ReplacementClosure) -> Self
Set the XML replacement (template- or closure-derived; built by the caller).
Sourcepub fn set_option(self, key: &str, value: OptionValue) -> Result<Self>
pub fn set_option(self, key: &str, value: OptionValue) -> Result<Self>
Apply a scalar option by name (see apply_scalar_option, the
single-source key→field map shared with EnvironmentBuilder).
Sourcepub fn after_digest(self, hook: DigestionClosure) -> Self
pub fn after_digest(self, hook: DigestionClosure) -> Self
Push an afterDigest hook (constructor: after digestion; environment:
runs on the \end whatsit — Perl semantics).
Sourcepub fn after_digest_begin(self, hook: DigestionClosure) -> Self
pub fn after_digest_begin(self, hook: DigestionClosure) -> Self
Push an afterDigestBegin hook (environments: runs on the \begin
whatsit right after its arguments digest).
Sourcepub fn after_digest_body(self, hook: DigestionClosure) -> Self
pub fn after_digest_body(self, hook: DigestionClosure) -> Self
Push an afterDigestBody hook (environments / box constructors: runs on
the whatsit after the captured body digests — Perl’s afterDigestBody).
Sourcepub fn before_digest(self, hook: BeforeDigestClosure) -> Self
pub fn before_digest(self, hook: BeforeDigestClosure) -> Self
Push a beforeDigest hook (runs before the arguments are digested —
Perl’s beforeDigest => sub {…}, e.g. \footnote’s neutralize_font).
Sourcepub fn before_digest_end(self, hook: BeforeDigestClosure) -> Self
pub fn before_digest_end(self, hook: BeforeDigestClosure) -> Self
Push a beforeDigestEnd hook (environments: before \end{…} digests).
Sourcepub fn before_construct(self, hook: ConstructionClosure) -> Self
pub fn before_construct(self, hook: ConstructionClosure) -> Self
Push a beforeConstruct hook (runs before the replacement absorbs).
Sourcepub fn after_construct(self, hook: ConstructionClosure) -> Self
pub fn after_construct(self, hook: ConstructionClosure) -> Self
Push an afterConstruct hook (runs after the replacement absorbs).
Sourcepub fn properties(self, props: PropertiesClosure) -> Self
pub fn properties(self, props: PropertiesClosure) -> Self
Set the properties closure (computes the whatsit’s property map from
the digested args — Perl’s properties => sub {…} / properties => {…}).
Sourcepub fn reversion(self, rev: Reversion) -> Self
pub fn reversion(self, rev: Reversion) -> Self
Set the reversion (reversion => "…" token form or a closure).
Sourcepub fn font(self, font: FontDirective) -> Self
pub fn font(self, font: FontDirective) -> Self
Set the font directive (font => { family => …, … }).
Sourcepub fn sizer(self, sizer: SizingClosure) -> Self
pub fn sizer(self, sizer: SizingClosure) -> Self
Set the sizer (sizer => sub {…} computing (width, height, depth)).