pub enum Transformation {
Trim,
Lowercase,
Uppercase,
RemoveWhitespace,
Regex {
pattern: String,
replacement: String,
},
RegexExtract {
pattern: String,
group: usize,
},
Coerce {
target_type: String,
},
Filter {
pattern: String,
},
NormalizeWhitespace,
StripHtml,
DecodeHtml,
ParseJson,
}Expand description
A transformation to apply to extracted values
Transformations are chained in order to clean, normalize, and validate extracted data.
Variants§
Trim
Trim whitespace from start and end
Lowercase
Convert to lowercase
Uppercase
Convert to uppercase
RemoveWhitespace
Remove all whitespace
Regex
Replace using a regex pattern
RegexExtract
Extract using a regex capture group
Coerce
Coerce to a specific type
Filter
Keep only if matches a regex pattern
NormalizeWhitespace
Replace multiple consecutive whitespace with single space
StripHtml
Remove HTML tags
DecodeHtml
Decode HTML entities
ParseJson
Parse JSON string into object
Implementations§
Trait Implementations§
Source§impl Clone for Transformation
impl Clone for Transformation
Source§fn clone(&self) -> Transformation
fn clone(&self) -> Transformation
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 Transformation
impl Debug for Transformation
Source§impl<'de> Deserialize<'de> for Transformation
impl<'de> Deserialize<'de> for Transformation
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 Transformation
impl Display for Transformation
Auto Trait Implementations§
impl Freeze for Transformation
impl RefUnwindSafe for Transformation
impl Send for Transformation
impl Sync for Transformation
impl Unpin for Transformation
impl UnsafeUnpin for Transformation
impl UnwindSafe for Transformation
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