pub struct Srs {
pub rules: Vec<SrsRule>,
}Expand description
A String Rewriting System.
Fields§
§rules: Vec<SrsRule>Implementations§
Source§impl Srs
impl Srs
Sourcepub fn add_rule(&mut self, lhs: impl Into<String>, rhs: impl Into<String>)
pub fn add_rule(&mut self, lhs: impl Into<String>, rhs: impl Into<String>)
Adds a rule lhs → rhs.
Sourcepub fn step(&self, s: &str) -> Option<String>
pub fn step(&self, s: &str) -> Option<String>
One-step reduction: applies the first applicable rule at any position.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Srs
impl RefUnwindSafe for Srs
impl Send for Srs
impl Sync for Srs
impl Unpin for Srs
impl UnsafeUnpin for Srs
impl UnwindSafe for Srs
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