pub enum Patch<T> {
Keep,
Clear,
Set(T),
}Expand description
A field that distinguishes “absent” from “null” in update commands
(channel.update with "topic": null clears the topic; no topic leaves it).
Use with #[serde(default, skip_serializing_if = "Patch::is_keep")].
Variants§
Keep
The field was absent: keep the current value.
Clear
The field was null: clear it.
Set(T)
The field was present: set it.
Implementations§
Trait Implementations§
Source§impl<'de, T: Deserialize<'de>> Deserialize<'de> for Patch<T>
impl<'de, T: Deserialize<'de>> Deserialize<'de> for Patch<T>
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl<T: Eq> Eq for Patch<T>
impl<T: PartialEq> StructuralPartialEq for Patch<T>
Auto Trait Implementations§
impl<T> Freeze for Patch<T>where
T: Freeze,
impl<T> RefUnwindSafe for Patch<T>where
T: RefUnwindSafe,
impl<T> Send for Patch<T>where
T: Send,
impl<T> Sync for Patch<T>where
T: Sync,
impl<T> Unpin for Patch<T>where
T: Unpin,
impl<T> UnsafeUnpin for Patch<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Patch<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