Struct Strides

Source
pub struct Strides<BC = Vec<u64>, CC = u64> {
    pub stride: CC,
    pub length: CC,
    pub bounds: BC,
}
Expand description

The first two integers describe a stride pattern, [stride, length].

If the length is zero the collection is empty. The first item pushed always becomes the first list element. The next element is the number of items at position i whose value is item * (i+1). After this comes the remaining entries in the bounds container.

Fields§

§stride: CC§length: CC§bounds: BC

Implementations§

Source§

impl Strides

Source

pub fn new(stride: u64, length: u64) -> Self

Source

pub fn push(&mut self, item: u64)

Source

pub fn clear(&mut self)

Source§

impl<BC: Deref<Target = [u64]>, CC: CopyAs<u64>> Strides<BC, CC>

Source

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

Source§

impl<BC: Len, CC: CopyAs<u64>> Strides<BC, CC>

Source

pub fn strided(&self) -> Option<u64>

Trait Implementations§

Source§

impl<'a, BC: AsBytes<'a>> AsBytes<'a> for Strides<BC, &'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 Clear for Strides

Source§

fn clear(&mut self)

Clears self, without changing its capacity.
Source§

impl<BC: Clone, CC: Clone> Clone for Strides<BC, CC>

Source§

fn clone(&self) -> Strides<BC, CC>

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 Container for Strides

Source§

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

Reborrows the borrowed type to a shorter lifetime. See [Columnar::reborrow] for details.

Source§

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

Reborrows the borrowed type to a shorter lifetime. See [Columnar::reborrow] for details.

Source§

type Ref<'a> = u64

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

type Borrowed<'a> = Strides<&'a [u64], &'a u64>

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.
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§

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

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

impl<BC: Debug, CC: Debug> Debug for Strides<BC, CC>

Source§

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

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

impl<BC: Default, CC: Default> Default for Strides<BC, CC>

Source§

fn default() -> Strides<BC, CC>

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

impl<'a, BC: FromBytes<'a>> FromBytes<'a> for Strides<BC, &'a u64>

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§

impl Index for Strides<&[u64], &u64>

Source§

type Ref = u64

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

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

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<BC: Len, CC: CopyAs<u64>> Len for Strides<BC, CC>

Source§

fn len(&self) -> usize

The number of contained elements.
Source§

fn is_empty(&self) -> bool

Whether this contains no elements.
Source§

impl<'a> Push<&'a u64> for Strides

Source§

fn push(&mut self, item: &'a u64)

Pushes an item onto self.
Source§

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

Pushes elements of an iterator onto self.
Source§

impl Push<u64> for Strides

Source§

fn push(&mut self, item: u64)

Pushes an item onto self.
Source§

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

Pushes elements of an iterator onto self.
Source§

impl<const K: u64, BC: Len, CC: CopyAs<u64>> TryFrom<Strides<BC, CC>> for Fixeds<K, CC>

Source§

type Error = Strides<BC, CC>

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

fn try_from(item: Strides<BC, CC>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<BC: Copy, CC: Copy> Copy for Strides<BC, CC>

Auto Trait Implementations§

§

impl<BC, CC> Freeze for Strides<BC, CC>
where CC: Freeze, BC: Freeze,

§

impl<BC, CC> RefUnwindSafe for Strides<BC, CC>

§

impl<BC, CC> Send for Strides<BC, CC>
where CC: Send, BC: Send,

§

impl<BC, CC> Sync for Strides<BC, CC>
where CC: Sync, BC: Sync,

§

impl<BC, CC> Unpin for Strides<BC, CC>
where CC: Unpin, BC: Unpin,

§

impl<BC, CC> UnwindSafe for Strides<BC, CC>
where CC: UnwindSafe, BC: 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.