[−][src]Struct flatk::chunked::Offsets
A collection of offsets into another collection. This newtype is intended to verify basic invariants about offsets into another collection, namely that the collection is monotonically increasing and non-empty.
Methods
impl<'a> Offsets<&'a [usize]>
[src]
pub fn pop_offset(&mut self) -> Option<usize>
[src]
Pops an offset from the given slice of offsets and produces an increment for
advancing the data pointer. This is a helper function for implementing
iterators over Chunked
types.
This function panics if offsets is empty.
impl<O: AsRef<[usize]>> Offsets<O>
[src]
impl<O> Offsets<O>
[src]
pub fn into_inner(self) -> O
[src]
Trait Implementations
impl<O: AsMut<[usize]>> AsMut<[usize]> for Offsets<O>
[src]
impl<O: AsRef<[usize]>> AsRef<[usize]> for Offsets<O>
[src]
impl Clear for Offsets
[src]
impl<O: Clone> Clone for Offsets<O>
[src]
impl<O: Copy> Copy for Offsets<O>
[src]
impl<O: Debug> Debug for Offsets<O>
[src]
impl Default for Offsets<Vec<usize>>
[src]
A default set of offsets must allocate.
impl<O: Dummy> Dummy for Offsets<O>
[src]
impl<O: AsRef<[usize]>> From<O> for Offsets<O>
[src]
impl<O: FromIterator<usize> + AsRef<[usize]>> FromIterator<usize> for Offsets<O>
[src]
fn from_iter<T>(iter: T) -> Self where
T: IntoIterator<Item = usize>,
[src]
T: IntoIterator<Item = usize>,
impl<'a, O: Get<'a, Range<usize>>> GetIndex<'a, Offsets<O>> for Range<usize>
[src]
impl<I: SliceIndex<[usize]>, O: AsRef<[usize]>> Index<I> for Offsets<O>
[src]
type Output = I::Output
The returned type after indexing.
fn index(&self, index: I) -> &Self::Output
[src]
impl<I: SliceIndex<[usize]>, O: AsRef<[usize]> + AsMut<[usize]>> IndexMut<I> for Offsets<O>
[src]
impl<O: AsRef<[usize]>> IndexRange for Offsets<O>
[src]
fn index_range(&self, range: Range<usize>) -> Option<Range<usize>>
[src]
Return the [begin..end)
bound of the chunk at the given index.
impl<O: IntoIterator> IntoIterator for Offsets<O>
[src]
type Item = O::Item
The type of the elements being iterated over.
type IntoIter = O::IntoIter
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl<O: IntoOwned> IntoOwned for Offsets<O>
[src]
type Owned = Offsets<O::Owned>
fn into_owned(self) -> Self::Owned
[src]
fn clone_into(self, target: &mut Self::Owned)
[src]
impl<O: Isolate<Range<usize>>> IsolateIndex<Offsets<O>> for Range<usize>
[src]
type Output = Offsets<O::Output>
fn try_isolate(self, offsets: Offsets<O>) -> Option<Self::Output>
[src]
impl<O: PartialEq> PartialEq<Offsets<O>> for Offsets<O>
[src]
impl<O: Push<usize>> Push<usize> for Offsets<O>
[src]
impl<O: RemovePrefix> RemovePrefix for Offsets<O>
[src]
fn remove_prefix(&mut self, n: usize)
[src]
impl<O: Reserve> Reserve for Offsets<O>
[src]
fn reserve_with_storage(&mut self, n: usize, storage_n: usize)
[src]
fn reserve(&mut self, n: usize)
[src]
impl<O: Set> Set for Offsets<O>
[src]
type Elem = O::Elem
Owned element of the set.
type Atom = O::Atom
The most basic element contained by this collection. If this collection contains other collections, this type should be different than Elem
. Read more
fn len(&self) -> usize
[src]
fn is_empty(&self) -> bool
[src]
impl<'a> SplitOffsetsAt for Offsets<&'a [usize]>
[src]
fn split_offsets_at(
self,
mid: usize
) -> (Offsets<&'a [usize]>, Offsets<&'a [usize]>, usize)
[src]
self,
mid: usize
) -> (Offsets<&'a [usize]>, Offsets<&'a [usize]>, usize)
Splits a slice of offsets at the given index into two slices such that each
slice is a valid slice of offsets. This means that the element at index
mid
is shared between the two output slices. In addition, return the
offset of the middle element: this is the value offsets[mid] - offsets[0]
.
Panics
Calling this function with an empty slice or with mid
greater than or equal to its length
will cause a panic.
impl<O> StructuralPartialEq for Offsets<O>
[src]
impl<O: Truncate> Truncate for Offsets<O>
[src]
impl<'a, O: AsRef<[usize]>> View<'a> for Offsets<O>
[src]
impl<'a, O: AsMut<[usize]>> ViewMut<'a> for Offsets<O>
[src]
impl<O: Viewed> Viewed for Offsets<O>
[src]
Auto Trait Implementations
impl<O> RefUnwindSafe for Offsets<O> where
O: RefUnwindSafe,
O: RefUnwindSafe,
impl<O> Send for Offsets<O> where
O: Send,
O: Send,
impl<O> Sync for Offsets<O> where
O: Sync,
O: Sync,
impl<O> Unpin for Offsets<O> where
O: Unpin,
O: Unpin,
impl<O> UnwindSafe for Offsets<O> where
O: UnwindSafe,
O: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> AsSlice<T> for T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<'a, S, I> Get<'a, I> for S where
I: GetIndex<'a, S>,
[src]
I: GetIndex<'a, S>,
type Output = <I as GetIndex<'a, S>>::Output
fn get(&Self, I) -> Option<<I as GetIndex<'a, S>>::Output>
[src]
fn at(&self, idx: I) -> Self::Output
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
fn into_iter(self) -> I
[src]
impl<S, I> Isolate<I> for S where
I: IsolateIndex<S>,
[src]
I: IsolateIndex<S>,
type Output = <I as IsolateIndex<S>>::Output
fn try_isolate(Self, I) -> Option<<S as Isolate<I>>::Output>
[src]
fn isolate(self, idx: I) -> Self::Output where
Self: Sized,
[src]
Self: Sized,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,