pub struct GrammarCoverageMatrix {
pub productions: HashMap<&'static str, ProductionStats>,
pub ast_variants: HashSet<String>,
pub uncovered: Vec<&'static str>,
}Expand description
Grammar coverage tracking matrix
Fields§
§productions: HashMap<&'static str, ProductionStats>§ast_variants: HashSet<String>§uncovered: Vec<&'static str>Implementations§
Source§impl GrammarCoverageMatrix
impl GrammarCoverageMatrix
Sourcepub fn record(
&mut self,
production: &'static str,
input: &str,
result: Result<Expr>,
elapsed: Duration,
)
pub fn record( &mut self, production: &'static str, input: &str, result: Result<Expr>, elapsed: Duration, )
Record a parse attempt
Sourcepub fn is_complete(&self, required_productions: usize) -> bool
pub fn is_complete(&self, required_productions: usize) -> bool
Check if coverage is complete
Sourcepub fn assert_complete(&self, required_productions: usize)
pub fn assert_complete(&self, required_productions: usize)
Assert that coverage is complete
§Panics
Panics if there are uncovered productions or if the number of covered productions is less than the required amount.
Trait Implementations§
Source§impl Default for GrammarCoverageMatrix
impl Default for GrammarCoverageMatrix
Source§fn default() -> GrammarCoverageMatrix
fn default() -> GrammarCoverageMatrix
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for GrammarCoverageMatrix
impl RefUnwindSafe for GrammarCoverageMatrix
impl Send for GrammarCoverageMatrix
impl Sync for GrammarCoverageMatrix
impl Unpin for GrammarCoverageMatrix
impl UnwindSafe for GrammarCoverageMatrix
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more