pub struct MapConfig {
pub mappings: Vec<MapMapping>,
}Expand description
Configuration for the map function containing a list of mappings.
Each mapping specifies a target path and a JSONLogic expression to evaluate. Mappings are processed sequentially, allowing later mappings to use results from earlier ones.
Fields§
§mappings: Vec<MapMapping>List of mappings to execute in order.
Implementations§
Source§impl MapConfig
impl MapConfig
Sourcepub fn execute(
&self,
message: &mut Message,
datalogic: &Arc<DataLogic>,
logic_cache: &[Arc<CompiledLogic>],
) -> Result<(usize, Vec<Change>)>
pub fn execute( &self, message: &mut Message, datalogic: &Arc<DataLogic>, logic_cache: &[Arc<CompiledLogic>], ) -> Result<(usize, Vec<Change>)>
Executes all map transformations using pre-compiled logic.
Processes each mapping sequentially, evaluating the JSONLogic expression and assigning the result to the target path. Changes are tracked for audit trail purposes.
§Arguments
message- The message to transform (modified in place)datalogic- DataLogic instance for evaluationlogic_cache- Pre-compiled logic expressions
§Returns
Ok((status, changes))- Status code (200 success, 500 if errors) and list of changesErr- If a critical error occurs during execution
§Behavior
- Null evaluation results are skipped (no assignment made)
- Root field assignments (data, metadata, temp_data) merge objects instead of replacing
- Each successful assignment invalidates the context cache for subsequent mappings
Trait Implementations§
Source§impl<'de> Deserialize<'de> for MapConfig
impl<'de> Deserialize<'de> for MapConfig
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 MapConfig
impl RefUnwindSafe for MapConfig
impl Send for MapConfig
impl Sync for MapConfig
impl Unpin for MapConfig
impl UnwindSafe for MapConfig
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