pub(crate) enum Target {
Literal(String),
Prefixed(String, BTreeSet<String>),
Template(Vec<Piece>, BTreeSet<String>),
Expr(String, BTreeSet<String>),
Any,
}Expand description
What an effect acts on inside its domain.
Variants§
Literal(String)
A string literal (a file path, a key).
Prefixed(String, BTreeSet<String>)
format!("prefix{x}.."): a computed string that starts with known text.
Template(Vec<Piece>, BTreeSet<String>)
format!("{dir}/cache.json"): text with holes, each a plain expression (a name or a
field), and the names it mentions. Within one region an expression has one value, so two
templates that agree piece by piece and then differ in their text name different strings.
Expr(String, BTreeSet<String>)
A computed value: its tokens and the names it mentions.
Any
Unknown: the whole domain.
Implementations§
Source§impl Target
impl Target
Sourcefn coarse(&self) -> Target
fn coarse(&self) -> Target
A template as the coarser target it refines: the text before its first hole.
fn may_alias(&self, other: &Target, fs: bool) -> bool
Sourcepub fn shown(&self) -> String
pub fn shown(&self) -> String
The target as reports show it: "cfg.toml", `path`, "out/"…; empty for any.
Sourcepub fn mentions_any(&self, names: &BTreeSet<String>) -> bool
pub fn mentions_any(&self, names: &BTreeSet<String>) -> bool
The target is computed from one of names (per-iteration bindings).
Source§impl Target
impl Target
Sourcepub fn single_name(&self) -> Option<&str>
pub fn single_name(&self) -> Option<&str>
The binding a computed target is, when it is just a name (path, &path).
Sourcepub fn informative(&self) -> bool
pub fn informative(&self) -> bool
Says more than “anything”: a literal, a known prefix or a template.