[][src]Trait subslice::SubsliceExt

pub trait SubsliceExt: Sealed {
    fn find(&self, other: &Self) -> Option<usize>;
fn rfind(&self, other: &Self) -> Option<usize>; }

Trait of types which can be searched for subsequences

Required methods

fn find(&self, other: &Self) -> Option<usize>

Find the first subslice of self which is equal to other, and return the index of its start.

O(self.len() + other.len()) time

fn rfind(&self, other: &Self) -> Option<usize>

Find the last subslice of self which is equal to other, and return the index of its start.

O(self.len() + other.len()) time

Loading content...

Implementors

impl SubsliceExt for str
[src]

impl<A: Ord> SubsliceExt for [A]
[src]

Loading content...