pub struct Fragment {
pub name: String,
pub file: String,
pub kind: String,
pub text: String,
pub line: usize,
pub placeholders: Vec<String>,
pub declared_options: Vec<String>,
pub supplied_variables: Vec<String>,
pub source: Arc<str>,
}Expand description
One named entry of a fragment file (ADR-0018).
Every field but name is read from the entry by the claiming engine’s own
parser — nothing is declared twice, so nothing can drift from the file.
Fields§
§name: StringThe name its # @proef annotation gave it (globally unique).
file: StringSource file name as authored — the file.hurl#name qualifier and the
diagnostic source.
kind: StringThe step kind whose engine scanned this file, taken from the
StepKindSpec whose fragments.ext claimed it. A ref: step routes by
this exactly as an inline step routes by its payload key (ADR-0002).
text: StringThe entry’s own text, annotation included.
line: usize1-based line the entry starts on.
placeholders: Vec<String>Variables the entry reads: its required inputs.
declared_options: Vec<String>Option families the entry sets for itself ("retry", "delay").
supplied_variables: Vec<String>Variables the entry supplies to itself ([Options] variable:): both an
answer to its own placeholders and a clash with a bind: of that name.
source: Arc<str>The fragment file’s text (for diagnostics).
Implementations§
Source§impl Fragment
impl Fragment
Sourcepub fn qualified(&self) -> String
pub fn qualified(&self) -> String
This fragment as file.hurl#name — the spelling a ref: accepts, and
what a run record carries so it can be read back long after the pack
that named it changed.
Next to PackSet::find_fragment, which parses the same form via
pack_ref_matches: producing it 400 lines from where it is consumed is
how the two stop agreeing on what the separator means.