Trait naive_opt::SearchIn[][src]

pub trait SearchIn<'a>: Sized {
    fn search_in(&self, haystack: &'a str) -> Option<usize>;
fn rsearch_in(&self, haystack: &'a str) -> Option<usize>;
fn len(&self) -> usize; fn is_empty(&self) -> bool { ... }
fn includes_in(&self, haystack: &'a str) -> bool { ... } }

search in the haystack

return index of the haystack, if it found the needle. Otherwise return None.

Required methods

fn search_in(&self, haystack: &'a str) -> Option<usize>[src]

search self in the haystack.

return index of the haystack, if it found self. Otherwise return None.

fn rsearch_in(&self, haystack: &'a str) -> Option<usize>[src]

reverse search self in the haystack.

return index of the haystack, if it found self. Otherwise return None.

fn len(&self) -> usize[src]

return the length of self

Loading content...

Provided methods

fn is_empty(&self) -> bool[src]

true if a length of 0.

fn includes_in(&self, haystack: &'a str) -> bool[src]

includes self in the haystack.

returns true if the given pattern matches a sub-slice of this string slice. returns false if it does not.

Loading content...

Implementations on Foreign Types

impl<'a, 'b> SearchIn<'a> for &'b str[src]

impl<'a, 'b> SearchIn<'a> for &'b String[src]

impl<'a, 'b> SearchIn<'a> for char[src]

Loading content...

Implementors

Loading content...