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>

Source

pub fn bounds(&self, index: usize) -> (usize, usize)

Lower and upper bounds in self.times and self.diffs of the indexed list.

Source

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.

Source

pub fn len(&self) -> usize

Number of lists in the container.

Source

pub fn get_abs(&self, index: usize) -> (T::ReadItem<'_>, D::ReadItem<'_>)

Retrieves a value using an absolute rather than relative index.

Source

pub fn with_capacity(o_size: usize, u_size: usize) -> Self

Allocates with capacities for a number of lists and values.

Source

pub fn merge_capacity(this: &Self, that: &Self) -> Self

Allocates with enough capacity to contain two inputs.

Trait Implementations§

Source§

impl<O: Debug, T: Debug, D: Debug> Debug for Upds<O, T, D>

Source§

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

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

impl<O: for<'a> BatchContainer<ReadItem<'a> = usize>, T: BatchContainer, D: BatchContainer> Default for Upds<O, T, D>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de, O, T, D> Deserialize<'de> for Upds<O, T, D>
where O: Deserialize<'de>, T: Deserialize<'de>, D: Deserialize<'de>,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<O, T, D> Serialize for Upds<O, T, D>
where O: Serialize, T: Serialize, D: Serialize,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<O, T, D> Freeze for Upds<O, T, D>
where O: Freeze, T: Freeze, D: Freeze,

§

impl<O, T, D> RefUnwindSafe for Upds<O, T, D>

§

impl<O, T, D> Send for Upds<O, T, D>
where O: Send, T: Send, D: Send,

§

impl<O, T, D> Sync for Upds<O, T, D>
where O: Sync, T: Sync, D: Sync,

§

impl<O, T, D> Unpin for Upds<O, T, D>
where O: Unpin, T: Unpin, D: Unpin,

§

impl<O, T, D> UnwindSafe for Upds<O, T, D>
where O: UnwindSafe, T: UnwindSafe, D: UnwindSafe,

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> 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<'a, S, T> Semigroup<&'a S> for T
where T: Semigroup<S>,

Source§

fn plus_equals(&mut self, rhs: &&'a S)

The method of std::ops::AddAssign, for types that do not implement AddAssign.
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,