pub struct Upds<O, T, D> {
pub offs: O,
pub times: T,
pub diffs: D,
}
Expand description
A container for non-empty lists of updates.
This container uses the special representiation of an empty slice to stand in for “the previous single element”. An empty slice is an otherwise invalid representation.
Fields§
§offs: O
Offsets used to provide indexes from values to updates.
times: T
Concatenated ordered lists of update times, bracketed by offsets in offs
.
diffs: D
Concatenated ordered lists of update diffs, bracketed by offsets in offs
.
Implementations§
Source§impl<O: for<'a> BatchContainer<ReadItem<'a> = usize>, T: BatchContainer, D: BatchContainer> Upds<O, T, D>
impl<O: for<'a> BatchContainer<ReadItem<'a> = usize>, T: BatchContainer, D: BatchContainer> Upds<O, T, D>
Sourcepub fn bounds(&self, index: usize) -> (usize, usize)
pub fn bounds(&self, index: usize) -> (usize, usize)
Lower and upper bounds in self.times
and self.diffs
of the indexed list.
Sourcepub fn get_rel(
&self,
list_idx: usize,
item_idx: usize,
) -> (T::ReadItem<'_>, D::ReadItem<'_>)
pub fn get_rel( &self, list_idx: usize, item_idx: usize, ) -> (T::ReadItem<'_>, D::ReadItem<'_>)
Retrieves a value using relative indexes.
The first index identifies a list, and the second an item within the list.
The method adds the list’s lower bound to the item index, and then calls
get_abs
. Using absolute indexes within the list’s bounds can be more
efficient than using relative indexing.
Sourcepub fn get_abs(&self, index: usize) -> (T::ReadItem<'_>, D::ReadItem<'_>)
pub fn get_abs(&self, index: usize) -> (T::ReadItem<'_>, D::ReadItem<'_>)
Retrieves a value using an absolute rather than relative index.
Sourcepub fn with_capacity(o_size: usize, u_size: usize) -> Self
pub fn with_capacity(o_size: usize, u_size: usize) -> Self
Allocates with capacities for a number of lists and values.
Sourcepub fn merge_capacity(this: &Self, that: &Self) -> Self
pub fn merge_capacity(this: &Self, that: &Self) -> Self
Allocates with enough capacity to contain two inputs.
Trait Implementations§
Source§impl<O: for<'a> BatchContainer<ReadItem<'a> = usize>, T: BatchContainer, D: BatchContainer> Default for Upds<O, T, D>
impl<O: for<'a> BatchContainer<ReadItem<'a> = usize>, T: BatchContainer, D: BatchContainer> Default for Upds<O, T, D>
Source§impl<'de, O, T, D> Deserialize<'de> for Upds<O, T, D>
impl<'de, O, T, D> Deserialize<'de> for Upds<O, T, D>
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>,
Auto Trait Implementations§
impl<O, T, D> Freeze for Upds<O, T, D>
impl<O, T, D> RefUnwindSafe for Upds<O, T, D>
impl<O, T, D> Send for Upds<O, T, D>
impl<O, T, D> Sync for Upds<O, T, D>
impl<O, T, D> Unpin for Upds<O, T, D>
impl<O, T, D> UnwindSafe for Upds<O, T, D>
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> 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 moreSource§impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
Source§fn plus_equals(&mut self, rhs: &&'a S)
fn plus_equals(&mut self, rhs: &&'a S)
std::ops::AddAssign
, for types that do not implement AddAssign
.