pub struct Vals<O, V> {
pub offs: O,
pub vals: V,
}
Expand description
A container for non-empty lists of values.
Fields§
§offs: O
Offsets used to provide indexes from keys to values.
The length of this list is one longer than keys
, so that we can avoid bounds logic.
vals: V
Concatenated ordered lists of values, bracketed by offsets in offs
.
Implementations§
Source§impl<O: for<'a> BatchContainer<ReadItem<'a> = usize>, V: BatchContainer> Vals<O, V>
impl<O: for<'a> BatchContainer<ReadItem<'a> = usize>, V: BatchContainer> Vals<O, V>
Sourcepub fn bounds(&self, index: usize) -> (usize, usize)
pub fn bounds(&self, index: usize) -> (usize, usize)
Lower and upper bounds in self.vals
of the indexed list.
Sourcepub fn get_rel(&self, list_idx: usize, item_idx: usize) -> V::ReadItem<'_>
pub fn get_rel(&self, list_idx: usize, item_idx: usize) -> V::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) -> V::ReadItem<'_>
pub fn get_abs(&self, index: usize) -> V::ReadItem<'_>
Retrieves a value using an absolute rather than relative index.
Sourcepub fn with_capacity(o_size: usize, v_size: usize) -> Self
pub fn with_capacity(o_size: usize, v_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>, V: BatchContainer> Default for Vals<O, V>
impl<O: for<'a> BatchContainer<ReadItem<'a> = usize>, V: BatchContainer> Default for Vals<O, V>
Source§impl<'de, O, V> Deserialize<'de> for Vals<O, V>where
O: Deserialize<'de>,
V: Deserialize<'de>,
impl<'de, O, V> Deserialize<'de> for Vals<O, V>where
O: Deserialize<'de>,
V: Deserialize<'de>,
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, V> Freeze for Vals<O, V>
impl<O, V> RefUnwindSafe for Vals<O, V>where
O: RefUnwindSafe,
V: RefUnwindSafe,
impl<O, V> Send for Vals<O, V>
impl<O, V> Sync for Vals<O, V>
impl<O, V> Unpin for Vals<O, V>
impl<O, V> UnwindSafe for Vals<O, V>where
O: UnwindSafe,
V: UnwindSafe,
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
.