pub enum NullablePatch<T> {
Absent,
Null,
Value(T),
}Expand description
Three-state nullable field used by PATCH-style request DTOs.
Absent means the request omitted the field and the existing value should be preserved.
Null means the request explicitly supplied null and the existing value should be cleared.
Value means the request supplied a concrete replacement value.
Variants§
Absent
Field was omitted from the request.
Null
Field was present with JSON null.
Value(T)
Field was present with a concrete value.
Implementations§
Source§impl<T> NullablePatch<T>
impl<T> NullablePatch<T>
Sourcepub fn is_present(&self) -> bool
pub fn is_present(&self) -> bool
Returns whether the request supplied this field as either null or a concrete value.
Trait Implementations§
Source§impl<T: Clone> Clone for NullablePatch<T>
impl<T: Clone> Clone for NullablePatch<T>
Source§fn clone(&self) -> NullablePatch<T>
fn clone(&self) -> NullablePatch<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for NullablePatch<T>
impl<T: Debug> Debug for NullablePatch<T>
Source§impl<T> Default for NullablePatch<T>
impl<T> Default for NullablePatch<T>
Source§fn default() -> NullablePatch<T>
fn default() -> NullablePatch<T>
Returns the “default value” for a type. Read more
Source§impl<'de, T> Deserialize<'de> for NullablePatch<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for NullablePatch<T>where
T: Deserialize<'de>,
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
Source§impl<T> From<Option<T>> for NullablePatch<T>
impl<T> From<Option<T>> for NullablePatch<T>
Source§impl<T: PartialEq> PartialEq for NullablePatch<T>
impl<T: PartialEq> PartialEq for NullablePatch<T>
Source§fn eq(&self, other: &NullablePatch<T>) -> bool
fn eq(&self, other: &NullablePatch<T>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<T: Copy> Copy for NullablePatch<T>
impl<T: Eq> Eq for NullablePatch<T>
impl<T> StructuralPartialEq for NullablePatch<T>
Auto Trait Implementations§
impl<T> Freeze for NullablePatch<T>where
T: Freeze,
impl<T> RefUnwindSafe for NullablePatch<T>where
T: RefUnwindSafe,
impl<T> Send for NullablePatch<T>where
T: Send,
impl<T> Sync for NullablePatch<T>where
T: Sync,
impl<T> Unpin for NullablePatch<T>where
T: Unpin,
impl<T> UnsafeUnpin for NullablePatch<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for NullablePatch<T>where
T: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.