pub enum TransformOperation {
Extract {
source_path: String,
target_field: String,
optional: bool,
default: Option<Value>,
},
Rename {
from: String,
to: String,
},
AddConstant {
field: String,
value: Value,
},
RemoveFields {
fields: Vec<String>,
},
FilterFields {
fields: Vec<String>,
},
StringTransform {
source_path: String,
target_field: String,
transform: StringTransformType,
},
MapValue {
source_path: String,
target_field: String,
mappings: HashMap<String, Value>,
default: Option<Value>,
},
Template {
target_field: String,
template: String,
},
Flatten {
source_path: String,
prefix: Option<String>,
separator: String,
},
Wrap {
wrapper_field: String,
},
Custom {
target_field: String,
expression: String,
},
}Expand description
A single transformation operation
Variants§
Extract
Extract a value from a path and store in output
Fields
Rename
Rename a field
AddConstant
Add a constant value to the output
RemoveFields
Remove specific fields from the payload
FilterFields
Keep only specific fields (whitelist)
StringTransform
Transform a string value using a pattern
Fields
§
transform: StringTransformTypeTransform type
MapValue
Map values to other values
Fields
Template
Template string with variable substitution
Fields
Flatten
Flatten nested object
Fields
Wrap
Wrap payload in a new structure
Custom
Custom transformation using an expression
Trait Implementations§
Source§impl Clone for TransformOperation
impl Clone for TransformOperation
Source§fn clone(&self) -> TransformOperation
fn clone(&self) -> TransformOperation
Returns a duplicate of the value. Read more
1.0.0 · 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 TransformOperation
impl Debug for TransformOperation
Source§impl<'de> Deserialize<'de> for TransformOperation
impl<'de> Deserialize<'de> for TransformOperation
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
Auto Trait Implementations§
impl Freeze for TransformOperation
impl RefUnwindSafe for TransformOperation
impl Send for TransformOperation
impl Sync for TransformOperation
impl Unpin for TransformOperation
impl UnwindSafe for TransformOperation
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