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 try_clone_for_decode(
&self,
ctx: &DecodeContext<'_>,
operation: &'static str,
) -> Result<Self, CodecError>
pub fn try_clone_for_decode( &self, ctx: &DecodeContext<'_>, operation: &'static str, ) -> Result<Self, CodecError>
Copy a dialect layer into a decoded report under the caller’s resource limits.
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,
ctx: &DecodeContext<'_>,
key: NonBlankString,
value: &str,
operation: &'static str,
) -> Result<Self, CodecError>
pub fn with_declared_entry( self, ctx: &DecodeContext<'_>, key: NonBlankString, value: &str, operation: &'static str, ) -> Result<Self, CodecError>
Adds one declaration after charging its map slot and owned value.
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.