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: T
The new element.
PushBack
An element was added at the back.
Fields
value: T
The 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: usize
The 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: T
The 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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more