pub trait ShapeExprParser: Send + Sync {
// Required methods
fn label(&self) -> &str;
fn parse_expr(&self, source: &str) -> Result<Expr>;
}Expand description
A parser that turns shape source text into an Expr for PrattShape.
Implementations plug a concrete grammar (the codec layer, not the kernel)
into shape matching; parse_expr should report a parse failure as
Error::Eval so the shape rejects rather than aborts.
Required Methods§
Sourcefn label(&self) -> &str
fn label(&self) -> &str
A short human-readable name for this parser, used in shape descriptions.
Sourcefn parse_expr(&self, source: &str) -> Result<Expr>
fn parse_expr(&self, source: &str) -> Result<Expr>
Parse source text into an expression to match against the inner shape.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".