pub struct ReplacementConfig {
pub key_replacements: SmallVec<[(String, String); 2]>,
pub value_replacements: SmallVec<[(String, String); 2]>,
}Expand description
Configuration for replacement operations
Fields§
§key_replacements: SmallVec<[(String, String); 2]>Key replacement patterns (find, replace) Uses SmallVec to avoid heap allocation for 0-2 replacements (common case)
value_replacements: SmallVec<[(String, String); 2]>Value replacement patterns (find, replace) Uses SmallVec to avoid heap allocation for 0-2 replacements (common case)
Implementations§
Source§impl ReplacementConfig
impl ReplacementConfig
Sourcepub fn add_key_replacement(
self,
find: impl Into<String>,
replace: impl Into<String>,
) -> Self
pub fn add_key_replacement( self, find: impl Into<String>, replace: impl Into<String>, ) -> Self
Add a key replacement pattern
Sourcepub fn add_value_replacement(
self,
find: impl Into<String>,
replace: impl Into<String>,
) -> Self
pub fn add_value_replacement( self, find: impl Into<String>, replace: impl Into<String>, ) -> Self
Add a value replacement pattern
Sourcepub fn has_key_replacements(&self) -> bool
pub fn has_key_replacements(&self) -> bool
Check if any key replacements are configured
Sourcepub fn has_value_replacements(&self) -> bool
pub fn has_value_replacements(&self) -> bool
Check if any value replacements are configured
Trait Implementations§
Source§impl Clone for ReplacementConfig
impl Clone for ReplacementConfig
Source§fn clone(&self) -> ReplacementConfig
fn clone(&self) -> ReplacementConfig
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 ReplacementConfig
impl Debug for ReplacementConfig
Source§impl Default for ReplacementConfig
impl Default for ReplacementConfig
Source§fn default() -> ReplacementConfig
fn default() -> ReplacementConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ReplacementConfig
impl RefUnwindSafe for ReplacementConfig
impl Send for ReplacementConfig
impl Sync for ReplacementConfig
impl Unpin for ReplacementConfig
impl UnsafeUnpin for ReplacementConfig
impl UnwindSafe for ReplacementConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more