pub struct FieldMapping {
pub from: Option<String>,
pub value: Option<Value>,
pub to: String,
}Expand description
Field mapping definition for transforms and sinks
Specifies how to extract or generate a value and where to place it. Used by remap transforms.
Fields§
§from: Option<String>Source field path (JSONPath-like, e.g., $.data.user_id)
OR template string (e.g. “Value: {{ $.data.value }}”)
OR built-in variable (e.g., “$UUID”)
One of from or value must be specified.
value: Option<Value>Static value or built-in variable to inject
Examples: “warning”, 123, true, “$UUID”, “$NOW”
One of from or value must be specified.
to: StringTarget field path (e.g., $.user_id)
Implementations§
Source§impl FieldMapping
impl FieldMapping
Sourcepub fn compile(&self) -> Result<CompiledMapping>
pub fn compile(&self) -> Result<CompiledMapping>
Compile this mapping into an efficient runtime representation
Trait Implementations§
Source§impl Clone for FieldMapping
impl Clone for FieldMapping
Source§impl Debug for FieldMapping
impl Debug for FieldMapping
Source§impl<'de> Deserialize<'de> for FieldMapping
impl<'de> Deserialize<'de> for FieldMapping
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 Forget for FieldMapping
impl Freeze for FieldMapping
impl RefUnwindSafe for FieldMapping
impl Send for FieldMapping
impl Sync for FieldMapping
impl Unpin for FieldMapping
impl UnsafeUnpin for FieldMapping
impl UnwindSafe for FieldMapping
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