Trait collections::slice::ImmutableEqVector[src]

pub trait ImmutableEqVector<T: PartialEq> {
    fn position_elem<T: PartialEq>(&self, t: &T) -> Option<uint>;
    fn rposition_elem<T: PartialEq>(&self, t: &T) -> Option<uint>;
    fn contains<T: PartialEq>(&self, x: &T) -> bool;
    fn starts_with<T: PartialEq>(&self, needle: &[T]) -> bool;
    fn ends_with<T: PartialEq>(&self, needle: &[T]) -> bool;
}

Extension methods for vectors contain PartialEq elements.

Required Methods

fn position_elem<T: PartialEq>(&self, t: &T) -> Option<uint>

Find the first index containing a matching value

fn rposition_elem<T: PartialEq>(&self, t: &T) -> Option<uint>

Find the last index containing a matching value

fn contains<T: PartialEq>(&self, x: &T) -> bool

Return true if a vector contains an element with the given value

fn starts_with<T: PartialEq>(&self, needle: &[T]) -> bool

Returns true if needle is a prefix of the vector.

fn ends_with<T: PartialEq>(&self, needle: &[T]) -> bool

Returns true if needle is a suffix of the vector.

Implementors