[−][src]Struct flatdata::ArrayView
A read-only view on a contiguous sequence of flatdata structs of the same
type T.
The sequence is written using Vector or ExternalVector. For detailed
examples see either of the two.
An archive provides a getter for each vector resource, which returns an array view.
Methods
impl<'a, T> ArrayView<'a, T> where
T: RefFactory, [src]
T: RefFactory,
pub fn new(data: &'a [u8]) -> Self[src]
Creates a new ArrayView to the data at the given address.
The returned array view does not own the data.
pub fn len(&self) -> usize[src]
Number of elements in the array.
pub fn is_empty(&self) -> bool[src]
Return true if the array is empty.
pub fn at(&self, index: usize) -> <T as Struct<'a>>::Item[src]
Returns a read-only handle to the element in the array at position
index.
Panics
Panics if index is greater than or equal to ArrayView::len().
pub fn slice<R: RangeBounds<usize>>(&self, range: R) -> Self[src]
Slice this array view by a given range.
Panics
Panics if the range is outside of bounds of array view.
pub fn iter(&self) -> ArrayViewIter<'a, T>[src]
Returns an iterator to the elements of the array.
pub fn as_bytes(&self) -> &[u8][src]
Returns a raw bytes representation of the underlying array data.
Trait Implementations
impl<'a, T: Clone> Clone for ArrayView<'a, T> where
T: RefFactory, [src]
T: RefFactory,
fn clone(&self) -> ArrayView<'a, T>[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl<'a, T> From<&'a Vector<T>> for ArrayView<'a, T> where
T: RefFactory, [src]
T: RefFactory,
impl<'a, T> IntoIterator for ArrayView<'a, T> where
T: RefFactory, [src]
T: RefFactory,
type Item = <ArrayViewIter<'a, T> as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = ArrayViewIter<'a, T>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter[src]
impl<'a, '_, T> IntoIterator for &'_ ArrayView<'a, T> where
T: RefFactory, [src]
T: RefFactory,
type Item = <ArrayViewIter<'a, T> as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = ArrayViewIter<'a, T>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter[src]
impl<'a, T> AsRef<[u8]> for ArrayView<'a, T> where
T: RefFactory, [src]
T: RefFactory,
impl<'a, T> Debug for ArrayView<'a, T> where
T: RefFactory, [src]
T: RefFactory,
Auto Trait Implementations
impl<'a, T> Sync for ArrayView<'a, T> where
T: Sync,
T: Sync,
impl<'a, T> Unpin for ArrayView<'a, T> where
T: Unpin,
T: Unpin,
impl<'a, T> Send for ArrayView<'a, T> where
T: Send,
T: Send,
impl<'a, T> UnwindSafe for ArrayView<'a, T> where
T: UnwindSafe,
T: UnwindSafe,
impl<'a, T> RefUnwindSafe for ArrayView<'a, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> From<T> for T[src]
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<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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,