pub struct FieldMapping {
pub source_field: String,
pub target_field: String,
pub mapping_type: FieldMappingType,
pub expression: Option<String>,
pub default_value: Option<String>,
pub required: bool,
pub description: Option<String>,
}Expand description
Individual field mapping
Fields§
§source_field: StringSource field name
target_field: StringTarget field name
mapping_type: FieldMappingTypeMapping type
expression: Option<String>Expression for computed fields
default_value: Option<String>Default value if source is null/missing
required: boolWhether this field is required
description: Option<String>Field description
Implementations§
Source§impl FieldMapping
impl FieldMapping
Sourcepub fn with_default(source: &str, target: &str, default: &str) -> Self
pub fn with_default(source: &str, target: &str, default: &str) -> Self
Create a field mapping with default value
Sourcepub fn with_description(self, description: &str) -> Self
pub fn with_description(self, description: &str) -> Self
Set the description
Trait Implementations§
Source§impl Clone for FieldMapping
impl Clone for FieldMapping
Source§fn clone(&self) -> FieldMapping
fn clone(&self) -> FieldMapping
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 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 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