Trait LRules

Source
pub trait LRules<T> {
    // Required method
    fn map(&self, input: &T) -> Option<Vec<T>>;
}
Expand description

A set of production rule for an L-system, which maps an item to a list of items which will replace it in the L-system state.

Required Methods§

Source

fn map(&self, input: &T) -> Option<Vec<T>>

perform a mapping of one atom to a string. It returns Some(Vec<T>) if the atom is a variable with an existing production rule, or None if the atom should be considered terminal.

Implementors§

Source§

impl<T> LRules<T> for MapRules<T>
where T: Clone + Hash + Eq + ?Sized,