pub struct Production {
pub lhs: Term,
/* private fields */
}Expand description
A Production is comprised of any number of Expressions
Fields§
§lhs: TermThe “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 Expressions
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 Expressions
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 Expressions
Trait Implementations§
Source§impl Clone for Production
impl Clone for Production
Source§fn clone(&self) -> Production
fn clone(&self) -> Production
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 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 for Production
impl PartialEq for Production
Source§impl Serialize for Production
impl Serialize for Production
impl Eq for Production
impl StructuralPartialEq for Production
Auto Trait Implementations§
impl Freeze for Production
impl RefUnwindSafe for Production
impl Send for Production
impl Sync for Production
impl Unpin for Production
impl UnwindSafe for Production
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