pub struct Expression { /* fields omitted */ }
An Expression is comprised of any number of Terms
Construct a new Expression
Construct an Expression
from Term
s
Remove Term
from Expression
If interested if Term
was removed, then inspect the returned Option
.
extern crate bnf;
use bnf::{Expression, Term};
fn main() {
let mut expression = Expression::from_parts(vec![]);
let to_remove = Term::Terminal(String::from("a_terminal"));
let removed = expression.remove_term(&to_remove);
match removed {
Some(term) => println!("removed {}", term),
None => println!("term was not in expression, so could not be removed"),
}
}
Get iterator of Term
s within Expression
Get mutable iterator of Term
s within Expression
This method tests for self
and other
values to be equal, and is used by ==
. Read more
This method tests for !=
.
Performs copy-assignment from source
. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
The associated error which can be returned from parsing.
Parses a string s
to return a value of this type. Read more
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String
. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static