pub enum MappingSource {
FromSource {
path: FieldPath,
default: Option<Value>,
transform: Option<Transformation>,
},
Constant(Value),
Computed {
inputs: Vec<FieldPath>,
function: ComputeFunction,
},
FromState {
path: String,
},
AsEvent {
fields: Vec<Box<MappingSource>>,
},
WholeSource,
AsCapture {
field_transforms: BTreeMap<String, Transformation>,
},
FromContext {
field: String,
},
}Variants§
FromSource
Constant(Value)
Computed
FromState
AsEvent
Fields
§
fields: Vec<Box<MappingSource>>WholeSource
AsCapture
Similar to WholeSource but with field-level transformations Used by #[capture] macro to apply transforms to specific fields in an account
Fields
§
field_transforms: BTreeMap<String, Transformation>FromContext
From instruction context (timestamp, slot, signature) Used by #[track_from] with special fields like __timestamp
Implementations§
Source§impl MappingSource
impl MappingSource
pub fn with_transform(self, transform: Transformation) -> Self
Trait Implementations§
Source§impl Clone for MappingSource
impl Clone for MappingSource
Source§fn clone(&self) -> MappingSource
fn clone(&self) -> MappingSource
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 MappingSource
impl Debug for MappingSource
Source§impl<'de> Deserialize<'de> for MappingSource
impl<'de> Deserialize<'de> for MappingSource
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 MappingSource
impl RefUnwindSafe for MappingSource
impl Send for MappingSource
impl Sync for MappingSource
impl Unpin for MappingSource
impl UnwindSafe for MappingSource
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