pub struct DialectMatch { /* private fields */ }Expand description
One format layer’s identification of one document.
A document carries several format layers: .sldprt contains Parasolid;
.f3d, .ipt, and SAT contain ACIS; NX contains Parasolid and JT. One
match describes one layer.
Implementations§
Source§impl DialectMatch
impl DialectMatch
Sourcepub fn admitted(dialect: DialectId) -> Self
pub fn admitted(dialect: DialectId) -> Self
Constructs a layer parsed with its identified dialect’s grammar.
Sourcepub fn unverified(dialect: DialectId, using: Grammar) -> Self
pub fn unverified(dialect: DialectId, using: Grammar) -> Self
Constructs a layer parsed unverified with another declared grammar.
using supplies its format-local name; the grammar’s namespace is the
layer’s own.
Sourcepub fn residual(dialect: DialectId) -> Self
pub fn residual(dialect: DialectId) -> Self
Constructs a layer parsed on the residual path without a declared grammar.
Sourcepub fn refused(dialect: DialectId) -> Self
pub fn refused(dialect: DialectId) -> Self
Constructs a structurally identified layer whose decode was refused.
Sourcepub fn with_declared(self, declared: BTreeMap<NonBlankString, String>) -> Self
pub fn with_declared(self, declared: BTreeMap<NonBlankString, String>) -> Self
Attaches source-declared version fields before the match enters a report.
Sourcepub fn with_declared_entry(self, key: NonBlankString, value: &str) -> Self
pub fn with_declared_entry(self, key: NonBlankString, value: &str) -> Self
Adds one declaration, replacing an earlier value for the same key.
Sourcepub fn with_instance(self, instance: impl Into<String>) -> Self
pub fn with_instance(self, instance: impl Into<String>) -> Self
Attaches a report-local layer instance before the match enters a report.
Sourcepub fn declared(&self) -> &BTreeMap<NonBlankString, String>
pub fn declared(&self) -> &BTreeMap<NonBlankString, String>
Returns the source-declared version fields.
Sourcepub fn using(&self) -> Option<DialectId>
pub fn using(&self) -> Option<DialectId>
Returns the full registry id of the grammar applied, when this layer was parsed unverified with a declared grammar.
Sourcepub fn grammar_id(&self, grammar: &Grammar) -> DialectId
pub fn grammar_id(&self, grammar: &Grammar) -> DialectId
Return the full grammar identity in this match’s format namespace.