pub struct RewriteProcessor { /* private fields */ }Expand description
A processor that applies transform rules to strings
Implementations§
Source§impl RewriteProcessor
impl RewriteProcessor
Sourcepub fn new(rules: Vec<TransformRule>) -> Result<Self, RewriteProcessorError>
pub fn new(rules: Vec<TransformRule>) -> Result<Self, RewriteProcessorError>
Create a new processor with the given rules
Sourcepub fn process(&self, input: &str) -> Result<String, RewriteProcessorError>
pub fn process(&self, input: &str) -> Result<String, RewriteProcessorError>
Apply all rules to the input string, returning the transformed result
Sourcepub fn would_modify(&self, input: &str) -> Result<bool, RewriteProcessorError>
pub fn would_modify(&self, input: &str) -> Result<bool, RewriteProcessorError>
Check if any rules would modify the input
Trait Implementations§
Source§impl Clone for RewriteProcessor
impl Clone for RewriteProcessor
Source§fn clone(&self) -> RewriteProcessor
fn clone(&self) -> RewriteProcessor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RewriteProcessor
impl RefUnwindSafe for RewriteProcessor
impl Send for RewriteProcessor
impl Sync for RewriteProcessor
impl Unpin for RewriteProcessor
impl UnsafeUnpin for RewriteProcessor
impl UnwindSafe for RewriteProcessor
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