pub enum Patch<T> {
Missing,
Null,
Value(T),
}Expand description
A field of a merge patch that may also be cleared: absent from the patch,
set to null, or given a value.
With the serde feature, it deserializes null as Patch::Null and a
value as Patch::Value; an absent field takes the default,
Patch::Missing, so put #[serde(default)] on the struct (or the
field). To document it with utoipa, give the field
#[schema(value_type = Option<T>)]: a nullable T, as clients send it.
Variants§
Missing
Absent from the patch: the field is left unchanged.
Null
Set to null: the field is cleared.
Value(T)
Given a value: the field is replaced.
Implementations§
Trait Implementations§
impl<T> Copy for Patch<T>where
T: Copy,
impl<T> Eq for Patch<T>where
T: Eq,
impl<T> StructuralPartialEq for Patch<T>where
T: PartialEq,
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