Struct tarrasque::View [−][src]
A slice of bytes containing values that span a fixed number of bytes.
Methods
impl<'a, T, P> View<'a, T, P> where
T: Extract<'a, P> + Span,
P: Copy,
[src]
impl<'a, T, P> View<'a, T, P> where
T: Extract<'a, P> + Span,
P: Copy,
pub fn bytes(&self) -> &'a [u8]
[src]
pub fn bytes(&self) -> &'a [u8]
Returns the bytes in this slice.
pub fn len(&self) -> usize
[src]
pub fn len(&self) -> usize
Returns the number of values in this slice.
pub fn is_empty(&self) -> bool
[src]
pub fn is_empty(&self) -> bool
Returns whether there are no values in this slice.
pub fn get(&self, index: usize) -> Option<&'a [u8]>
[src]
pub fn get(&self, index: usize) -> Option<&'a [u8]>
Returns the bytes for the value at the supplied index in this slice.
pub fn extract(&self, index: usize) -> Option<T>
[src]
pub fn extract(&self, index: usize) -> Option<T>
Returns the value at the supplied index in this slice.
ⓘImportant traits for ViewIter<'a, T, P>pub fn iter(self) -> ViewIter<'a, T, P>
[src]
pub fn iter(self) -> ViewIter<'a, T, P>
Returns an iterator over the values in this slice.
pub fn binary_search(&self, value: &T) -> Option<usize> where
T: Ord,
[src]
pub fn binary_search(&self, value: &T) -> Option<usize> where
T: Ord,
Binary searches the values in this slice for the supplied value.
pub fn binary_search_by<F>(&self, f: F) -> Option<(usize, T)> where
F: FnMut(&T) -> Ordering,
[src]
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.
pub fn binary_search_by_key<U, F>(&self, key: &U, f: F) -> Option<(usize, T)> where
U: Ord,
F: FnMut(&T) -> U,
[src]
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.
pub fn binary_search_bytes(&self, bytes: &[u8]) -> Option<usize>
[src]
pub fn binary_search_bytes(&self, bytes: &[u8]) -> Option<usize>
Binary searches the value bytes in this slice for the supplied value.
pub fn binary_search_bytes_by<F>(&self, f: F) -> Option<(usize, &'a [u8])> where
F: FnMut(&'a [u8]) -> Ordering,
[src]
pub fn binary_search_bytes_by<F>(&self, f: F) -> Option<(usize, &'a [u8])> where
F: FnMut(&'a [u8]) -> Ordering,
Binary searches the value bytes in this slice using the supplied comparator function.
pub fn binary_search_bytes_by_key<U, F>(
&self,
key: &U,
f: F
) -> Option<(usize, &'a [u8])> where
U: Ord,
F: FnMut(&'a [u8]) -> U,
[src]
pub fn binary_search_bytes_by_key<U, F>(
&self,
key: &U,
f: F
) -> Option<(usize, &'a [u8])> where
U: Ord,
F: FnMut(&'a [u8]) -> U,
Binary searches the value bytes in this slice using the supplied key extraction function.
Trait Implementations
impl<'a, T: Copy, P: Copy> Copy for View<'a, T, P> where
T: Extract<'a, P> + Span,
P: Copy,
[src]
impl<'a, T: Copy, P: Copy> Copy for View<'a, T, P> where
T: Extract<'a, P> + Span,
P: Copy,
impl<'a, T: Clone, P: Clone> Clone for View<'a, T, P> where
T: Extract<'a, P> + Span,
P: Copy,
[src]
impl<'a, T: Clone, P: Clone> Clone for View<'a, T, P> where
T: Extract<'a, P> + Span,
P: Copy,
fn clone(&self) -> View<'a, T, P>
[src]
fn clone(&self) -> View<'a, T, P>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<'a, T: Debug, P: Debug> Debug for View<'a, T, P> where
T: Extract<'a, P> + Span,
P: Copy,
[src]
impl<'a, T: Debug, P: Debug> Debug for View<'a, T, P> where
T: Extract<'a, P> + Span,
P: Copy,
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<'a, T: PartialEq, P: PartialEq> PartialEq for View<'a, T, P> where
T: Extract<'a, P> + Span,
P: Copy,
[src]
impl<'a, T: PartialEq, P: PartialEq> PartialEq for View<'a, T, P> where
T: Extract<'a, P> + Span,
P: Copy,
fn eq(&self, other: &View<'a, T, P>) -> bool
[src]
fn eq(&self, other: &View<'a, T, P>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &View<'a, T, P>) -> bool
[src]
fn ne(&self, other: &View<'a, T, P>) -> bool
This method tests for !=
.
impl<'a, T: Eq, P: Eq> Eq for View<'a, T, P> where
T: Extract<'a, P> + Span,
P: Copy,
[src]
impl<'a, T: Eq, P: Eq> Eq for View<'a, T, P> where
T: Extract<'a, P> + Span,
P: Copy,
impl<'a, T, P> Extract<'a, (usize, P)> for View<'a, T, P> where
T: Extract<'a, P> + Span,
P: Copy,
[src]
impl<'a, T, P> Extract<'a, (usize, P)> for View<'a, T, P> where
T: Extract<'a, P> + Span,
P: Copy,
fn extract(
stream: &mut Stream<'a>,
(values, parameter): (usize, P)
) -> ExtractResult<'a, Self>
[src]
fn extract(
stream: &mut Stream<'a>,
(values, parameter): (usize, P)
) -> ExtractResult<'a, Self>
Extracts a value of this type from the supplied stream of bytes. Read more