pub enum VectorDiff<T> {
Append {
values: Vector<T>,
},
Clear,
PushFront {
value: T,
},
PushBack {
value: T,
},
PopFront,
PopBack,
Insert {
index: usize,
value: T,
},
Set {
index: usize,
value: T,
},
Remove {
index: usize,
},
Truncate {
length: usize,
},
Reset {
values: Vector<T>,
},
}Expand description
A change to an ObservableVector.
Variants§
Append
Multiple elements were appended.
Clear
The vector was cleared.
PushFront
An element was added at the front.
Fields
value: TThe new element.
PushBack
An element was added at the back.
Fields
value: TThe new element.
PopFront
The element at the front was removed.
PopBack
The element at the back was removed.
Insert
An element was inserted at the given position.
Fields
index: usizeThe index of the new element.
The element that was previously at that index as well as all the ones after it were shifted to the right.
value: TThe new element.
Set
A replacement of the previous value at the given position.
Remove
Removal of an element.
Truncate
Truncation of the vector.
Reset
The subscriber lagged too far behind, and the next update that should have been received has already been discarded from the internal buffer.
Implementations§
Source§impl<T: Clone> VectorDiff<T>
impl<T: Clone> VectorDiff<T>
Sourcepub fn map<U: Clone>(self, f: impl FnMut(T) -> U) -> VectorDiff<U>
pub fn map<U: Clone>(self, f: impl FnMut(T) -> U) -> VectorDiff<U>
Transform VectorDiff<T> into VectorDiff<U> by applying the given
function to any contained items.
Trait Implementations§
Source§impl<T: Clone> Clone for VectorDiff<T>
impl<T: Clone> Clone for VectorDiff<T>
Source§fn clone(&self) -> VectorDiff<T>
fn clone(&self) -> VectorDiff<T>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<T: Debug> Debug for VectorDiff<T>
impl<T: Debug> Debug for VectorDiff<T>
impl<T: Eq> Eq for VectorDiff<T>
Source§impl<T: PartialEq> PartialEq for VectorDiff<T>
impl<T: PartialEq> PartialEq for VectorDiff<T>
Source§impl<T> Serialize for VectorDiff<T>
Available on crate feature serde only.
impl<T> Serialize for VectorDiff<T>
serde only.impl<T: PartialEq> StructuralPartialEq for VectorDiff<T>
Auto Trait Implementations§
impl<T> Freeze for VectorDiff<T>
impl<T> RefUnwindSafe for VectorDiff<T>
impl<T> Send for VectorDiff<T>
impl<T> Sync for VectorDiff<T>
impl<T> Unpin for VectorDiff<T>
impl<T> UnsafeUnpin for VectorDiff<T>
impl<T> UnwindSafe for VectorDiff<T>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.