Trait egg::LanguageChildren [−][src]
pub trait LanguageChildren {
fn len(&self) -> usize;
fn can_be_length(n: usize) -> bool;
fn from_vec(v: Vec<Id>) -> Self;
fn as_slice(&self) -> &[Id];
fn as_mut_slice(&mut self) -> &mut [Id];
fn is_empty(&self) -> bool { ... }
}
Expand description
A marker that defines acceptable children types for define_language!
.
See define_language!
for more details.
You should not have to implement this trait.
Required methods
fn can_be_length(n: usize) -> bool
fn can_be_length(n: usize) -> bool
Checks if n is an acceptable number of children for this type.
Create an instance of this type from a Vec<Id>
,
with the guarantee that can_be_length is already true on the Vec
.
fn as_mut_slice(&mut self) -> &mut [Id]
fn as_mut_slice(&mut self) -> &mut [Id]
Returns a mutable slice of the children Id
s.