[−][src]Trait flatk::View
A trait defining a collection that can be accessed via an immutable (shared) view. This type of view can be cloned and copied.
Associated Types
Loading content...Required methods
Loading content...Implementations on Foreign Types
impl<'a, T: 'a> View<'a> for [T; 1]
[src]
impl<'a, T: 'a> View<'a> for [T; 2]
[src]
impl<'a, T: 'a> View<'a> for [T; 3]
[src]
impl<'a, T: 'a> View<'a> for [T; 4]
[src]
impl<'a, T: 'a> View<'a> for [T; 5]
[src]
impl<'a, T: 'a> View<'a> for [T; 6]
[src]
impl<'a, T: 'a> View<'a> for [T; 7]
[src]
impl<'a, T: 'a> View<'a> for [T; 8]
[src]
impl<'a, T: 'a> View<'a> for [T; 9]
[src]
impl<'a, T: 'a> View<'a> for [T; 10]
[src]
impl<'a, T: 'a> View<'a> for [T; 11]
[src]
impl<'a, T: 'a> View<'a> for [T; 12]
[src]
impl<'a, T: 'a> View<'a> for [T; 13]
[src]
impl<'a, T: 'a> View<'a> for [T; 14]
[src]
impl<'a, T: 'a> View<'a> for [T; 15]
[src]
impl<'a, T: 'a> View<'a> for [T; 16]
[src]
impl<'a, S: View<'a>> View<'a> for Box<S>
[src]
impl<'a, I: IntBound> View<'a> for Range<I>
[src]
impl<'a, I: IntBound> View<'a> for RangeInclusive<I>
[src]
impl<'a, I: IntBound> View<'a> for RangeTo<I>
[src]
impl<'a, I: IntBound> View<'a> for RangeToInclusive<I>
[src]
impl<'a, T: 'a> View<'a> for [T]
[src]
impl<'a, S: View<'a>, T: View<'a>> View<'a> for (S, T)
[src]
impl<'a, T: 'a> View<'a> for Vec<T>
[src]
impl<'a, '_, S: ?Sized + 'a + View<'a>> View<'a> for &'_ S
[src]
Blanket implementation of View
for all immutable borrows.
impl<'a, '_, S: ?Sized + 'a + View<'a>> View<'a> for &'_ mut S
[src]
Blanket implementation of View
for all mutable borrows.
Implementors
impl<'a, O: AsRef<[usize]>> View<'a> for Offsets<O>
[src]
impl<'a, O: AsRef<[usize]>> View<'a> for SortedChunks<O>
[src]
impl<'a, S, I> View<'a> for Select<S, I> where
S: View<'a>,
I: AsRef<[usize]>,
[src]
S: View<'a>,
I: AsRef<[usize]>,
impl<'a, S, I> View<'a> for Subset<S, I> where
S: View<'a>,
I: AsRef<[usize]>,
[src]
S: View<'a>,
I: AsRef<[usize]>,
Required for Chunked
and UniChunked
subsets.
impl<'a, S, N> View<'a> for UniChunked<S, N> where
S: View<'a>,
N: Copy,
[src]
S: View<'a>,
N: Copy,
type Type = UniChunked<<S as View<'a>>::Type, N>
fn view(&'a self) -> Self::Type
[src]
Create a UniChunked
contiguous immutable (shareable) view into the
underlying collection.
Example
use flatk::*; let s = UniChunked::<_, U2>::from_flat(vec![0,1,2,3]); let v1 = s.view(); // s is now inaccessible. let v2 = v1.clone(); let mut view1_iter = v1.iter(); assert_eq!(Some(&[0,1]), view1_iter.next()); assert_eq!(Some(&[2,3]), view1_iter.next()); assert_eq!(None, view1_iter.next()); for ((a, b), c) in v1.iter().zip(v2.iter()).zip(s.iter()) { assert_eq!(a,b); assert_eq!(b,c); }
impl<'a, S, O> View<'a> for Chunked<S, O> where
S: View<'a>,
O: View<'a>,
[src]
S: View<'a>,
O: View<'a>,
type Type = Chunked<S::Type, O::Type>
fn view(&'a self) -> Self::Type
[src]
Create a contiguous immutable (shareable) view into this set.
Example
use flatk::*; let s = Chunked::<Vec<usize>>::from_offsets(vec![0,1,4,6], vec![0,1,2,3,4,5]); let v1 = s.view(); let v2 = v1.clone(); let mut view1_iter = v1.clone().into_iter(); assert_eq!(Some(&[0][..]), view1_iter.next()); assert_eq!(Some(&[1,2,3][..]), view1_iter.next()); assert_eq!(Some(&[4,5][..]), view1_iter.next()); assert_eq!(None, view1_iter.next()); for (a,b) in v1.into_iter().zip(v2.into_iter()) { assert_eq!(a,b); }
impl<'a, S, T, I> View<'a> for Sparse<S, T, I> where
S: View<'a>,
T: View<'a>,
I: AsRef<[usize]>,
[src]
S: View<'a>,
T: View<'a>,
I: AsRef<[usize]>,