Struct bnf::Expression [−][src]
pub struct Expression { /* fields omitted */ }Expand description
An Expression is comprised of any number of Terms
Implementations
Construct a new Expression
Construct an Expression from Terms
Remove Term from Expression
If interested if Term was removed, then inspect the returned Option.
Example
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 Terms within Expression
Get mutable iterator of Terms within Expression
Trait Implementations
Returns the “default value” for a type. Read more
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
Auto Trait Implementations
impl RefUnwindSafe for Expression
impl Send for Expression
impl Sync for Expression
impl Unpin for Expression
impl UnwindSafe for Expression
Blanket Implementations
Mutably borrows from an owned value. Read more
