Skip to main content

FromRuleContext

Trait FromRuleContext 

Source
pub trait FromRuleContext: Sized {
    // Required method
    fn from_rule_context(context: &ParserRuleContext) -> Option<Self>;
}
Expand description

Conversion from a dynamic ParserRuleContext into a generated typed context view.

Implemented by generated per-rule / per-labeled-alternative context types so ctx.downcast_ref::<XContext>() can check the rule shape and materialize the typed view, mirroring ANTLR’s context-class casts.

Required Methods§

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§