pub struct ProductionString { /* private fields */ }
Expand description
Represents strings in our L-system. Strings
are made up of a list of Symbol
objects.
If you would like to parse an instance of this struct
from a string, you can use
parser::parse_prod_string
, like so:
use rusty_systems::parser;
let axiom = parser::parse_prod_string("Forward Forward Forward").unwrap();
Implementations§
Source§impl ProductionString
impl ProductionString
Sourcepub fn empty() -> Self
pub fn empty() -> Self
Creates an / the empty production string. This is a
synonym for ProductionString::new
.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Whether the production string is empty or not. i.e., whether this is the empty string.
Sourcepub fn push_symbol(&mut self, symbol: Symbol)
pub fn push_symbol(&mut self, symbol: Symbol)
Add another symbol to the end of the string.
Trait Implementations§
Source§impl Clone for ProductionString
impl Clone for ProductionString
Source§fn clone(&self) -> ProductionString
fn clone(&self) -> ProductionString
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ProductionString
impl Debug for ProductionString
Source§impl Default for ProductionString
impl Default for ProductionString
Source§impl Display for ProductionString
impl Display for ProductionString
Source§impl From<Symbol> for ProductionString
impl From<Symbol> for ProductionString
Source§impl Hash for ProductionString
impl Hash for ProductionString
Source§impl Index<usize> for ProductionString
impl Index<usize> for ProductionString
Source§impl<'a> IntoIterator for &'a ProductionString
impl<'a> IntoIterator for &'a ProductionString
Source§impl IntoIterator for ProductionString
impl IntoIterator for ProductionString
Source§impl PartialEq for ProductionString
impl PartialEq for ProductionString
Source§impl SymbolIterable for ProductionString
impl SymbolIterable for ProductionString
Source§fn all_symbols_iter(&self) -> impl Iterator<Item = Symbol>
fn all_symbols_iter(&self) -> impl Iterator<Item = Symbol>
Iterate over all symbols contained in the object.
Source§fn all_symbols<C: FromIterator<Symbol>>(&self) -> C
fn all_symbols<C: FromIterator<Symbol>>(&self) -> C
Creates a collection of all the symbols that
[
self.all_symbols_iter
] iterates over. Read moreimpl Eq for ProductionString
impl StructuralPartialEq for ProductionString
Auto Trait Implementations§
impl Freeze for ProductionString
impl RefUnwindSafe for ProductionString
impl Send for ProductionString
impl Sync for ProductionString
impl Unpin for ProductionString
impl UnwindSafe for ProductionString
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