Enum eyeball_im::VectorDiff
source · 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
Fields
value: T
The new element.
An element was added at the front.
PushBack
Fields
value: T
The new element.
An element was added at the back.
PopFront
The element at the front was removed.
PopBack
The element at the back was removed.
Insert
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.
An element was inserted at the given position.
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 moresource§impl<T: Debug> Debug for VectorDiff<T>
impl<T: Debug> Debug for VectorDiff<T>
source§impl<T: PartialEq> PartialEq for VectorDiff<T>
impl<T: PartialEq> PartialEq for VectorDiff<T>
source§fn eq(&self, other: &VectorDiff<T>) -> bool
fn eq(&self, other: &VectorDiff<T>) -> bool
self
and other
values to be equal, and is used
by ==
.