pub struct TransformRule {
pub pattern: String,
pub replacement: String,
pub flags: Option<String>,
pub max_applications: usize,
}Expand description
A single transformation rule that operates on complete strings
Fields§
§pattern: StringThe regex pattern - should match entire input with captures
replacement: StringThe replacement - reconstructs entire output using captures
flags: Option<String>Optional regex flags
max_applications: usizeMaximum number of applications (0 = unlimited)
Implementations§
Source§impl TransformRule
impl TransformRule
Sourcepub fn with_flags(self, flags: &str) -> Self
pub fn with_flags(self, flags: &str) -> Self
Add regex flags (i=case insensitive, m=multiline, s=dot matches newline)
Sourcepub const fn with_max_applications(self, max: usize) -> Self
pub const fn with_max_applications(self, max: usize) -> Self
Set maximum number of applications
Trait Implementations§
Source§impl Clone for TransformRule
impl Clone for TransformRule
Source§fn clone(&self) -> TransformRule
fn clone(&self) -> TransformRule
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 moreSource§impl Debug for TransformRule
impl Debug for TransformRule
Source§impl<'de> Deserialize<'de> for TransformRule
impl<'de> Deserialize<'de> for TransformRule
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 PartialEq for TransformRule
impl PartialEq for TransformRule
Source§fn eq(&self, other: &TransformRule) -> bool
fn eq(&self, other: &TransformRule) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for TransformRule
impl Serialize for TransformRule
impl StructuralPartialEq for TransformRule
Auto Trait Implementations§
impl Freeze for TransformRule
impl RefUnwindSafe for TransformRule
impl Send for TransformRule
impl Sync for TransformRule
impl Unpin for TransformRule
impl UnsafeUnpin for TransformRule
impl UnwindSafe for TransformRule
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