pub struct ResolvedDeclarations { /* private fields */ }Expand description
A project’s declarations, checked and projected into signature data by
Declarations::resolve.
The environment signature tier plus semantic-only command aliases. This is
the only signature data the parser accepts: a value can only come from a
declaration block, so parse_with_declarations cannot be handed a document’s
merged package/definition scope. The parser reads only db; semantic-model
construction reads commands.
Implementations§
Source§impl ResolvedDeclarations
impl ResolvedDeclarations
Sourcepub fn as_db(&self) -> &SignatureDb
pub fn as_db(&self) -> &SignatureDb
The declared tier as signature data, for merging into a document’s scope (where it is the top tier: a declaration is the user explicitly correcting an inference).
Sourcepub fn command_like(&self, name: &str) -> Option<&str>
pub fn command_like(&self, name: &str) -> Option<&str>
The built-in semantic target of a declared command alias.
Sourcepub fn command_names(&self) -> impl Iterator<Item = &str>
pub fn command_names(&self) -> impl Iterator<Item = &str>
The declared command names, in deterministic order.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Whether nothing was declared — the common case, and the one that must cost the parse nothing.
Sourcepub fn parse_tier(&self) -> Self
pub fn parse_tier(&self) -> Self
The parse-facing half of this block: the environment signature tier, with the semantic command aliases dropped.
The two halves are split so a reader depends only on the one it uses. A
command alias provably cannot change a tree
(command_declarations_do_not_change_the_parse_tree), so an incremental
front end can hold this half behind its own firewall and leave every parse
standing when only [commands] changed. The environment tier is what
parse_with_declarations and the
signature scope read.
Sourcepub fn semantic_tier(&self) -> Self
pub fn semantic_tier(&self) -> Self
The semantic-facing half: the command aliases alone.
The counterpart of parse_tier, read by
SemanticModel::build_with_declarations,
which never looks at the environment tier. Together the two halves
partition the block: nothing is in both, and nothing in neither.
Trait Implementations§
Source§impl Clone for ResolvedDeclarations
impl Clone for ResolvedDeclarations
Source§fn clone(&self) -> ResolvedDeclarations
fn clone(&self) -> ResolvedDeclarations
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more