Helpers for composing RustQ splice replacements as plain keyword lists.
Splices use the same shape accepted by RustQ.render/3:
[items: [RustQ.Rust.item("pub fn generated() {}")]]merge/1 also accepts nested splice sources, so manifests can compose output
from several generators without wrapper structs.
Summary
Functions
Appends replacement fragments to a splice name.
Merges splice sources, concatenating duplicate names.
Replaces all fragments for a splice name.
Types
Functions
@spec append(t(), name(), replacement()) :: t()
Appends replacement fragments to a splice name.
Merges splice sources, concatenating duplicate names.
Accepts ordinary keywords, maps, or nested lists of splice sources:
RustQ.Splice.merge([
BaseGenerator.splices(schema),
NativeGenerator.splices(schema),
items: RustQ.Rust.item("pub fn generated() {}")
])
@spec put(t(), name(), replacement()) :: t()
Replaces all fragments for a splice name.