pub trait TreeLikewhere
Self: Sized,{
// Required methods
fn get_rule_id(&self, n: NodeID) -> RuleID;
fn size(&self) -> usize;
fn to_tree(&self, _: &Context) -> Tree;
fn get_rule<'c>(&self, n: NodeID, ctx: &'c Context) -> &'c Rule;
fn get_rule_or_custom(&self, n: NodeID) -> &RuleIDOrCustom;
fn get_custom_rule_data(&self, n: NodeID) -> &[u8] ⓘ;
// Provided methods
fn get_nonterm_id(&self, n: NodeID, ctx: &Context) -> NTermID { ... }
fn unparse<W: Write>(&self, id: NodeID, ctx: &Context, w: &mut W) { ... }
fn unparse_to<W: Write>(&self, ctx: &Context, w: &mut W) { ... }
fn unparse_to_vec(&self, ctx: &Context) -> Vec<u8> ⓘ { ... }
fn unparse_node_to_vec(&self, n: NodeID, ctx: &Context) -> Vec<u8> ⓘ { ... }
fn unparse_print(&self, ctx: &Context) { ... }
}Required Methods§
fn get_rule_id(&self, n: NodeID) -> RuleID
fn size(&self) -> usize
fn to_tree(&self, _: &Context) -> Tree
fn get_rule<'c>(&self, n: NodeID, ctx: &'c Context) -> &'c Rule
fn get_rule_or_custom(&self, n: NodeID) -> &RuleIDOrCustom
fn get_custom_rule_data(&self, n: NodeID) -> &[u8] ⓘ
Provided Methods§
fn get_nonterm_id(&self, n: NodeID, ctx: &Context) -> NTermID
fn unparse<W: Write>(&self, id: NodeID, ctx: &Context, w: &mut W)
fn unparse_to<W: Write>(&self, ctx: &Context, w: &mut W)
fn unparse_to_vec(&self, ctx: &Context) -> Vec<u8> ⓘ
fn unparse_node_to_vec(&self, n: NodeID, ctx: &Context) -> Vec<u8> ⓘ
fn unparse_print(&self, ctx: &Context)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.