#[non_exhaustive]pub enum OnNull {
Skip,
Unset,
}Expand description
What a MapMapping does when its logic evaluates to null.
#[non_exhaustive]: a later minor may add a spelling — writing an explicit
null, say, which no mapping can do today.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Skip
Leave the path as it was. A var that misses and an if with no
matching branch both produce null, so skipping is what keeps a
missing source from wiping its target — and what makes
{"if": [cond, value, null]} mean “set or keep”.
Unset
Remove the key at path, exactly as MapMapping::unset would:
{"if": [cond, value, null]} then means “set or clear”.
Trait Implementations§
impl Copy for OnNull
Source§impl<'de> Deserialize<'de> for OnNull
impl<'de> Deserialize<'de> for OnNull
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
impl Eq for OnNull
impl StructuralPartialEq for OnNull
Auto Trait Implementations§
impl Freeze for OnNull
impl RefUnwindSafe for OnNull
impl Send for OnNull
impl Sync for OnNull
impl Unpin for OnNull
impl UnsafeUnpin for OnNull
impl UnwindSafe for OnNull
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