pub enum DIFUpdateData {
Replace {
value: DIFValueContainer,
},
Set {
key: DIFKey,
value: DIFValueContainer,
},
Delete {
key: DIFKey,
},
Clear,
Append {
value: DIFValueContainer,
},
ListSplice {
start: u32,
delete_count: u32,
items: Vec<DIFValueContainer>,
},
}Expand description
Represents an update operation for a DIF value.
Variants§
Replace
Represents a replacement operation for a DIF value.
Fields
value: DIFValueContainerSet
Represents an update to a specific property of a DIF value.
The key specifies which property to update, and value is the new value for that property.
Delete
Represents the removal of a specific property from a DIF value.
Clear
Represents clearing all elements from a collection-type DIF value (like an array or map).
Append
Represents adding a new element to a collection-type DIF value (like an array or map).
Fields
value: DIFValueContainerListSplice
Special update operation for list values that allows splicing
Implementations§
Source§impl DIFUpdateData
impl DIFUpdateData
Sourcepub fn replace(value: impl Into<DIFValueContainer>) -> Self
pub fn replace(value: impl Into<DIFValueContainer>) -> Self
Creates a new DIFUpdateData::Replace variant with the given value.
Sourcepub fn set(key: impl Into<DIFKey>, value: impl Into<DIFValueContainer>) -> Self
pub fn set(key: impl Into<DIFKey>, value: impl Into<DIFValueContainer>) -> Self
Creates a new DIFUpdateData::Set variant with the given key and value.
Sourcepub fn delete(key: impl Into<DIFKey>) -> Self
pub fn delete(key: impl Into<DIFKey>) -> Self
Creates a new DIFUpdateData::Delete variant with the given key.
Sourcepub fn append(value: impl Into<DIFValueContainer>) -> Self
pub fn append(value: impl Into<DIFValueContainer>) -> Self
Creates a new DIFUpdateData::Append variant with the given value.
Sourcepub fn list_splice(range: Range<u32>, items: Vec<DIFValueContainer>) -> Self
pub fn list_splice(range: Range<u32>, items: Vec<DIFValueContainer>) -> Self
Creates a new DIFUpdateData::ListSplice variant with the given parameters.
pub fn with_source(&self, source_id: TransceiverId) -> DIFUpdate<'_>
Trait Implementations§
Source§impl Clone for DIFUpdateData
impl Clone for DIFUpdateData
Source§fn clone(&self) -> DIFUpdateData
fn clone(&self) -> DIFUpdateData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl DIFConvertible for DIFUpdateData
impl DIFConvertible for DIFUpdateData
Source§impl Debug for DIFUpdateData
impl Debug for DIFUpdateData
Source§impl<'de> Deserialize<'de> for DIFUpdateData
impl<'de> Deserialize<'de> for DIFUpdateData
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>,
Source§impl<'a> From<&'a DIFUpdateData> for DIFUpdateDataOrMemory<'a>
impl<'a> From<&'a DIFUpdateData> for DIFUpdateDataOrMemory<'a>
Source§fn from(update: &'a DIFUpdateData) -> Self
fn from(update: &'a DIFUpdateData) -> Self
Source§impl PartialEq for DIFUpdateData
impl PartialEq for DIFUpdateData
Source§impl Serialize for DIFUpdateData
impl Serialize for DIFUpdateData
impl StructuralPartialEq for DIFUpdateData
Auto Trait Implementations§
impl Freeze for DIFUpdateData
impl RefUnwindSafe for DIFUpdateData
impl Send for DIFUpdateData
impl Sync for DIFUpdateData
impl Unpin for DIFUpdateData
impl UnwindSafe for DIFUpdateData
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more