Struct bnf::Production
source · pub struct Production {
pub lhs: Term,
/* private fields */
}
Expand description
A Production is comprised of any number of Expressions
Fields§
§lhs: Term
The “left hand side” of the production, i.e. “lhs -> rhs …”
Implementations§
source§impl Production
impl Production
sourcepub fn new() -> Production
pub fn new() -> Production
Construct a new Production
sourcepub fn from_parts(t: Term, e: Vec<Expression>) -> Production
pub fn from_parts(t: Term, e: Vec<Expression>) -> Production
Construct an Production
from Expression
s
sourcepub fn add_to_rhs(&mut self, expr: Expression)
pub fn add_to_rhs(&mut self, expr: Expression)
Add Expression
to the Production
’s right hand side
sourcepub fn remove_from_rhs(&mut self, expr: &Expression) -> Option<Expression>
pub fn remove_from_rhs(&mut self, expr: &Expression) -> Option<Expression>
Remove Expression
from the Production
’s right hand side
If interested if Expression
was removed, then inspect the returned Option
.
sourcepub fn rhs_iter(&self) -> impl Iterator<Item = &Expression>
pub fn rhs_iter(&self) -> impl Iterator<Item = &Expression>
Get iterator of the Production
’s right hand side Expression
s
sourcepub fn rhs_iter_mut(&mut self) -> impl Iterator<Item = &mut Expression>
pub fn rhs_iter_mut(&mut self) -> impl Iterator<Item = &mut Expression>
Get mutable iterator of the Production
’s right hand side Expression
s
Trait Implementations§
source§impl Clone for Production
impl Clone for Production
source§fn clone(&self) -> Production
fn clone(&self) -> Production
Returns a copy 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 Production
impl Debug for Production
source§impl Default for Production
impl Default for Production
source§impl<'de> Deserialize<'de> for Production
impl<'de> Deserialize<'de> for Production
source§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
source§impl Display for Production
impl Display for Production
source§impl FromStr for Production
impl FromStr for Production
source§impl Hash for Production
impl Hash for Production
source§impl PartialEq<Production> for Production
impl PartialEq<Production> for Production
source§fn eq(&self, other: &Production) -> bool
fn eq(&self, other: &Production) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.