Skip to main content

Repeats

Struct Repeats 

Source
pub struct Repeats<TC, CC = Vec<u64>, VC = Vec<u64>, WC = [u64; 2]> {
    pub inner: Options<TC, CC, VC, WC>,
}
Expand description

A container that encodes repeated values with a None variant, at the cost of extra bits for every record.

Fields§

§inner: Options<TC, CC, VC, WC>

Some(x) encodes a value, and None indicates the prior x value.

Trait Implementations§

Source§

impl<'a, TC: AsBytes<'a>, CC: AsBytes<'a>, VC: AsBytes<'a>> AsBytes<'a> for Repeats<TC, CC, VC, &'a [u64]>

Source§

fn as_bytes(&self) -> impl Iterator<Item = (u64, &'a [u8])>

Presents self as a sequence of byte slices, with their required alignment.
Source§

impl<TC: Borrow> Borrow for Repeats<TC>

Source§

type Ref<'a> = <TC as Borrow>::Ref<'a> where TC: 'a

For each lifetime, a reference with that lifetime. Read more
Source§

type Borrowed<'a> = Repeats<<TC as Borrow>::Borrowed<'a>, &'a [u64], &'a [u64], &'a [u64]> where TC: 'a

The type of a borrowed container. Read more
Source§

fn borrow<'a>(&'a self) -> Self::Borrowed<'a>

Converts a reference to the type to a borrowed variant. Read more
Source§

fn reborrow<'b, 'a: 'b>(thing: Self::Borrowed<'a>) -> Self::Borrowed<'b>
where TC: 'a,

Reborrows the borrowed type to a shorter lifetime. See Columnar::reborrow for details.
Source§

fn reborrow_ref<'b, 'a: 'b>(thing: Self::Ref<'a>) -> Self::Ref<'b>
where Self: 'a,

Reborrows the borrowed type to a shorter lifetime. See Columnar::reborrow for details.
Source§

impl<TC: Clear> Clear for Repeats<TC>

Source§

fn clear(&mut self)

Clears self, without changing its capacity.
Source§

impl<TC: Clone, CC: Clone, VC: Clone, WC: Clone> Clone for Repeats<TC, CC, VC, WC>

Source§

fn clone(&self) -> Repeats<TC, CC, VC, WC>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<TC: Container> Container for Repeats<TC>
where for<'a> &'a TC: Index, for<'a> TC::Ref<'a>: PartialEq, for<'a, 'b> <&'a TC as Index>::Ref: PartialEq<TC::Ref<'b>>,

Source§

fn extend_from_self(&mut self, other: Self::Borrowed<'_>, range: Range<usize>)

Extends self by a range in other. Read more
Source§

fn reserve_for<'a, I>(&mut self, selves: I)
where Self: 'a, I: Iterator<Item = Self::Borrowed<'a>> + Clone,

Source§

fn with_capacity_for<'a, I>(selves: I) -> Self
where Self: 'a, I: Iterator<Item = Self::Borrowed<'a>> + Clone,

Allocates an empty container that can be extended by selves without reallocation. Read more
Source§

impl<TC: Debug, CC: Debug, VC: Debug, WC: Debug> Debug for Repeats<TC, CC, VC, WC>

Source§

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

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

impl<TC: Default, CC: Default, VC: Default, WC: Default> Default for Repeats<TC, CC, VC, WC>

Source§

fn default() -> Repeats<TC, CC, VC, WC>

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

impl<'a, TC: FromBytes<'a>, CC: FromBytes<'a>, VC: FromBytes<'a>> FromBytes<'a> for Repeats<TC, CC, VC, &'a [u64]>

Source§

const SLICE_COUNT: usize = Options<TC, CC, VC, &'a [u64]>::SLICE_COUNT

The number of byte slices this type consumes when reconstructed.
Source§

fn from_bytes(bytes: &mut impl Iterator<Item = &'a [u8]>) -> Self

Reconstructs self from a sequence of correctly aligned and sized bytes slices. Read more
Source§

fn from_store(store: &DecodedStore<'a>, offset: &mut usize) -> Self

Reconstructs self from a DecodedStore, using direct random access at a given offset. Read more
Source§

fn element_sizes(sizes: &mut Vec<usize>) -> Result<(), String>

Reports the element sizes (in bytes) for each slice this type consumes. Read more
Source§

fn validate(slices: &[(&[u64], u8)]) -> Result<(), String>
where Self: Sized,

Validates that the given slices are compatible with this type. Read more
Source§

impl<'a, TC> Index for &'a Repeats<TC>
where &'a TC: Index,

Source§

type Ref = <&'a TC as Index>::Ref

The type returned by the get method. Read more
Source§

fn get(&self, index: usize) -> Self::Ref

Returns the reference type for location index. Read more
Source§

fn last(&self) -> Option<Self::Ref>
where Self: Len,

Source§

fn index_iter(&self) -> IterOwn<&Self>

Converts &self into an iterator. Read more
Source§

fn into_index_iter(self) -> IterOwn<Self>
where Self: Sized,

Converts self into an iterator. Read more
Source§

impl<TC: Index, CC: IndexAs<u64> + Len, VC: IndexAs<u64> + Len, WC: IndexAs<u64>> Index for Repeats<TC, CC, VC, WC>

Source§

type Ref = <TC as Index>::Ref

The type returned by the get method. Read more
Source§

fn get(&self, index: usize) -> Self::Ref

Returns the reference type for location index. Read more
Source§

fn last(&self) -> Option<Self::Ref>
where Self: Len,

Source§

fn index_iter(&self) -> IterOwn<&Self>

Converts &self into an iterator. Read more
Source§

fn into_index_iter(self) -> IterOwn<Self>
where Self: Sized,

Converts self into an iterator. Read more
Source§

impl<TC, CC, VC: Len, WC: IndexAs<u64>> Len for Repeats<TC, CC, VC, WC>

Source§

fn len(&self) -> usize

The number of contained elements.
Source§

fn is_empty(&self) -> bool

Whether this contains no elements.
Source§

impl<TC: PartialEq, CC: PartialEq, VC: PartialEq, WC: PartialEq> PartialEq for Repeats<TC, CC, VC, WC>

Source§

fn eq(&self, other: &Repeats<TC, CC, VC, WC>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: PartialEq, TC: Push<T> + Len> Push<T> for Repeats<TC>
where for<'a> &'a TC: Index, for<'a> <&'a TC as Index>::Ref: PartialEq<T>,

Source§

fn push(&mut self, item: T)

Pushes an item onto self.
Source§

fn extend(&mut self, iter: impl IntoIterator<Item = T>)

Pushes elements of an iterator onto self.
Source§

impl<TC: Copy, CC: Copy, VC: Copy, WC: Copy> Copy for Repeats<TC, CC, VC, WC>

Source§

impl<TC, CC, VC, WC> StructuralPartialEq for Repeats<TC, CC, VC, WC>

Auto Trait Implementations§

§

impl<TC, CC, VC, WC> Freeze for Repeats<TC, CC, VC, WC>
where TC: Freeze, CC: Freeze, VC: Freeze, WC: Freeze,

§

impl<TC, CC, VC, WC> RefUnwindSafe for Repeats<TC, CC, VC, WC>

§

impl<TC, CC, VC, WC> Send for Repeats<TC, CC, VC, WC>
where TC: Send, CC: Send, VC: Send, WC: Send,

§

impl<TC, CC, VC, WC> Sync for Repeats<TC, CC, VC, WC>
where TC: Sync, CC: Sync, VC: Sync, WC: Sync,

§

impl<TC, CC, VC, WC> Unpin for Repeats<TC, CC, VC, WC>
where TC: Unpin, CC: Unpin, VC: Unpin, WC: Unpin,

§

impl<TC, CC, VC, WC> UnsafeUnpin for Repeats<TC, CC, VC, WC>

§

impl<TC, CC, VC, WC> UnwindSafe for Repeats<TC, CC, VC, WC>
where TC: UnwindSafe, CC: UnwindSafe, VC: UnwindSafe, WC: 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> CopyAs<T> for T
where T: Copy,

Source§

fn copy_as(self) -> T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, S> IndexAs<S> for T
where T: Index, <T as Index>::Ref: CopyAs<S>,

Source§

fn index_as(&self, index: usize) -> S

Source§

fn last(&self) -> Option<T>
where Self: Len,

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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, C> PushIndexAs<T> for C
where C: BorrowIndexAs<T> + Container + for<'a> Push<&'a T>,