Skip to main content

UpdateOperation

Enum UpdateOperation 

Source
pub enum UpdateOperation {
    Replace(Box<ReplaceUpdateData>),
    SetEntry(Box<SetEntryUpdateData>),
    DeleteEntry(Box<DeleteEntryUpdateData>),
    Clear,
    AppendEntry(Box<AppendEntryUpdateData>),
    ListSplice(Box<ListSpliceUpdateData>),
    Increment(Box<IncrementUpdateData>),
    Decrement(Box<DecrementUpdateData>),
}

Variants§

§

Replace(Box<ReplaceUpdateData>)

Represents a replacement operation for a value.

§

SetEntry(Box<SetEntryUpdateData>)

Represents an update to a specific property of a value. The key specifies which property to update, and value is the new value for that property.

§

DeleteEntry(Box<DeleteEntryUpdateData>)

Represents the removal of a specific property from a value.

§

Clear

Represents clearing all elements from a collection-type value (like an array or map).

§

AppendEntry(Box<AppendEntryUpdateData>)

Represents adding a new element to a collection-type value (like an array or map).

§

ListSplice(Box<ListSpliceUpdateData>)

Special update operation for list values that allows splicing

§

Increment(Box<IncrementUpdateData>)

Increment operation for numeric values

§

Decrement(Box<DecrementUpdateData>)

Decrement operation for numeric values

Implementations§

Source§

impl UpdateOperation

Source

pub fn replace(value: ValueContainer) -> Self

Source

pub fn set_entry(key: ValueContainer, value: ValueContainer) -> Self

Source

pub fn delete_entry(key: ValueContainer) -> Self

Source

pub fn clear() -> Self

Source

pub fn append_entry(value: ValueContainer) -> Self

Source

pub fn list_splice( start_index: u32, delete_count: u32, items_to_insert: Vec<ValueContainer>, ) -> Self

Source

pub fn increment(amount: ValueContainer) -> Self

Source

pub fn decrement(amount: ValueContainer) -> Self

Source§

impl UpdateOperation

Source

pub fn with_source( self, source_id: TransceiverId, path: Vec<ValueContainer>, ) -> Update

Creates a new Update struct with the given TransceiverId as source id.

Source

pub fn with_source_root(self, source_id: TransceiverId) -> Update

Creates a new Update struct with the given TransceiverId as source id and an empty path.

Trait Implementations§

Source§

impl AsRef<str> for UpdateOperation

Source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for UpdateOperation

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for UpdateOperation

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for UpdateOperation

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for UpdateOperation

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for UpdateOperation

Source§

impl ToInstructions for UpdateOperation

Appends a single update operation on a shared container

Source§

fn to_instructions<'a>( &'a self, visitor: &'a mut dyn ValueVisitor, cache: &'a mut SharedReferencesCache, ) -> Box<dyn Iterator<Item = Instruction> + 'a>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> DynEq for T
where T: Any,

Source§

default fn dyn_eq(&self, _other: &(dyn Any + 'static)) -> bool

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> TryClone for T

Source§

default fn try_clone(&self) -> Result<Value, ()>

Attempts to clone Self into a new Value.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T, U> TypeSubset<U> for T
where U: TypeSuperset<T>,

Source§

fn is_subset_of(&self, other: &U) -> bool

Returns whether self is a subset of type