pub enum ListPatch<U> {
Update {
index: usize,
patch: U,
},
Insert {
index: usize,
value: U,
},
Push {
value: U,
},
Overwrite {
values: Vec<U>,
},
Remove {
index: usize,
},
Clear,
}Expand description
ListPatch
Positional list patches applied in order.
Indices refer to the list state at the time each patch executes.
Insert clamps out-of-bounds indices to the tail; Remove ignores invalid indices.
Update only applies to existing elements and never creates new entries.
Overwrite replaces the entire list with the provided values.
Variants§
Trait Implementations§
Source§impl<U> CandidType for ListPatch<U>where
U: CandidType,
impl<U> CandidType for ListPatch<U>where
U: CandidType,
Source§impl<'de, U> Deserialize<'de> for ListPatch<U>where
U: Deserialize<'de>,
impl<'de, U> Deserialize<'de> for ListPatch<U>where
U: Deserialize<'de>,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ListPatch<U>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ListPatch<U>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<U> Serialize for ListPatch<U>where
U: Serialize,
impl<U> Serialize for ListPatch<U>where
U: Serialize,
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl<U> Freeze for ListPatch<U>where
U: Freeze,
impl<U> RefUnwindSafe for ListPatch<U>where
U: RefUnwindSafe,
impl<U> Send for ListPatch<U>where
U: Send,
impl<U> Sync for ListPatch<U>where
U: Sync,
impl<U> Unpin for ListPatch<U>where
U: Unpin,
impl<U> UnsafeUnpin for ListPatch<U>where
U: UnsafeUnpin,
impl<U> UnwindSafe for ListPatch<U>where
U: 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