pub struct PackSet {
pub macros: BTreeMap<String, Macro>,
pub fragments: Arc<BTreeMap<String, Fragment>>,
pub bind: BTreeMap<String, BTreeMap<String, String>>,
}Expand description
A validated set of packs: every macro, indexed by (globally unique) name, plus the fragments packs may reference and the pack-scope bindings.
Fields§
§macros: BTreeMap<String, Macro>All macros by name (pass 3 guarantees global uniqueness).
fragments: Arc<BTreeMap<String, Fragment>>All named fragments by name — globally unique for the same reason macro
names are: a ref: names one thing, wherever it was declared (ADR-0018).
Shared rather than owned: one scan serves every load of the same corpus
(see FragmentCorpus), so handing it to four loads costs four
refcounts, not four copies of the corpus.
bind: BTreeMap<String, BTreeMap<String, String>>Pack-scope bind: tables, keyed by pack name so a binding stays
attributable to the file that declared it.
Implementations§
Source§impl PackSet
impl PackSet
Sourcepub fn step_defs(&self) -> Vec<(&str, &str)>
pub fn step_defs(&self) -> Vec<(&str, &str)>
(pattern, macro name) pairs for the step binder — macros with a
match: only.
Sourcepub fn find_use_target(&self, target: &str) -> Option<&Macro>
pub fn find_use_target(&self, target: &str) -> Option<&Macro>
Resolve a use: target (name or pack.yaml#name) to a macro.
Sourcepub fn find_fragment(&self, target: &str) -> Option<&Fragment>
pub fn find_fragment(&self, target: &str) -> Option<&Fragment>
Resolve a ref: target (name or file.hurl#name) to a fragment —
the same two spellings use: accepts, qualified the same way, because
they answer the same question.