Expand description
A slice of bytes containing values that span a fixed number of bytes.
Implementations
sourceimpl<'s, T, P> View<'s, T, P>where
T: Extract<'s, P> + Span,
P: Copy,
impl<'s, T, P> View<'s, T, P>where
T: Extract<'s, P> + Span,
P: Copy,
sourcepub fn get(&self, index: usize) -> Option<&'s [u8]>
pub fn get(&self, index: usize) -> Option<&'s [u8]>
Returns the bytes for the value at the supplied index in this slice.
sourcepub fn extract(&self, index: usize) -> Option<T>
pub fn extract(&self, index: usize) -> Option<T>
Returns the value at the supplied index in this slice.
sourcepub fn try_extract(&self, index: usize) -> Option<ExtractResult<'s, T>>
pub fn try_extract(&self, index: usize) -> Option<ExtractResult<'s, T>>
Returns the value at the supplied index in this slice.
sourcepub fn iter(self) -> ViewIter<'s, T, P>ⓘNotable traits for ViewIter<'s, T, P>impl<'s, T, P> Iterator for ViewIter<'s, T, P>where
T: Extract<'s, P> + Span,
P: Copy, type Item = T;
pub fn iter(self) -> ViewIter<'s, T, P>ⓘNotable traits for ViewIter<'s, T, P>impl<'s, T, P> Iterator for ViewIter<'s, T, P>where
T: Extract<'s, P> + Span,
P: Copy, type Item = T;
T: Extract<'s, P> + Span,
P: Copy, type Item = T;
Returns an iterator over the values in this slice.
sourcepub fn binary_search(&self, value: &T) -> Option<usize>where
T: Ord,
pub fn binary_search(&self, value: &T) -> Option<usize>where
T: Ord,
Binary searches the values in this slice for the supplied value.
sourcepub fn binary_search_by<F>(&self, f: F) -> Option<(usize, T)>where
F: FnMut(&T) -> Ordering,
pub fn binary_search_by<F>(&self, f: F) -> Option<(usize, T)>where
F: FnMut(&T) -> Ordering,
Binary searches the values in this slice using the supplied comparator function.
sourcepub fn binary_search_by_key<U, F>(&self, key: &U, f: F) -> Option<(usize, T)>where
U: Ord,
F: FnMut(&T) -> U,
pub fn binary_search_by_key<U, F>(&self, key: &U, f: F) -> Option<(usize, T)>where
U: Ord,
F: FnMut(&T) -> U,
Binary searches the values in this slice using the supplied key extraction function.
sourcepub fn binary_search_bytes(&self, bytes: &[u8]) -> Option<usize>
pub fn binary_search_bytes(&self, bytes: &[u8]) -> Option<usize>
Binary searches the value bytes in this slice for the supplied value.
Trait Implementations
sourceimpl<'s, T, P> Extract<'s, (usize, P)> for View<'s, T, P>where
T: Extract<'s, P> + Span,
P: Copy,
impl<'s, T, P> Extract<'s, (usize, P)> for View<'s, T, P>where
T: Extract<'s, P> + Span,
P: Copy,
sourceimpl<'s, T: PartialEq, P: PartialEq> PartialEq<View<'s, T, P>> for View<'s, T, P>where
T: Extract<'s, P> + Span,
P: Copy,
impl<'s, T: PartialEq, P: PartialEq> PartialEq<View<'s, T, P>> for View<'s, T, P>where
T: Extract<'s, P> + Span,
P: Copy,
impl<'s, T: Copy, P: Copy> Copy for View<'s, T, P>where
T: Extract<'s, P> + Span,
P: Copy,
impl<'s, T: Eq, P: Eq> Eq for View<'s, T, P>where
T: Extract<'s, P> + Span,
P: Copy,
impl<'s, T, P> StructuralEq for View<'s, T, P>where
T: Extract<'s, P> + Span,
P: Copy,
impl<'s, T, P> StructuralPartialEq for View<'s, T, P>where
T: Extract<'s, P> + Span,
P: Copy,
Auto Trait Implementations
impl<'s, T, P> RefUnwindSafe for View<'s, T, P>where
P: RefUnwindSafe,
T: RefUnwindSafe,
impl<'s, T, P> !Send for View<'s, T, P>
impl<'s, T, P> !Sync for View<'s, T, P>
impl<'s, T, P> Unpin for View<'s, T, P>where
P: Unpin,
impl<'s, T, P> UnwindSafe for View<'s, T, P>where
P: UnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more