Trait std::slice::ImmutableEqVector
pub trait ImmutableEqVector<T: Eq> { fn position_elem(&self, t: &T) -> Option<uint>; fn rposition_elem(&self, t: &T) -> Option<uint>; fn contains(&self, x: &T) -> bool; fn starts_with(&self, needle: &[T]) -> bool; fn ends_with(&self, needle: &[T]) -> bool; }
Extension methods for vectors contain Eq
elements.
Required Methods
fn position_elem(&self, t: &T) -> Option<uint>
Find the first index containing a matching value
fn rposition_elem(&self, t: &T) -> Option<uint>
Find the last index containing a matching value
fn contains(&self, x: &T) -> bool
Return true if a vector contains an element with the given value
fn starts_with(&self, needle: &[T]) -> bool
Returns true if needle
is a prefix of the vector.
fn ends_with(&self, needle: &[T]) -> bool
Returns true if needle
is a suffix of the vector.
Implementors
impl<'a, T: Eq> ImmutableEqVector<T> for &'a [T]