Skip to main content

FindSubstring

Trait FindSubstring 

pub trait FindSubstring<T> {
    // Required method
    fn find_substring(&self, substr: T) -> Option<usize>;
}
Available on crate feature rustls only.
Expand description

Look for a substring in self

Required Methods§

fn find_substring(&self, substr: T) -> Option<usize>

Returns the byte position of the substring if it is found

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

§

impl<'a, 'b> FindSubstring<&'b str> for &'a str

§

fn find_substring(&self, substr: &'b str) -> Option<usize>

§

impl<'a, 'b> FindSubstring<&'b str> for &'a [u8]

§

fn find_substring(&self, substr: &'b str) -> Option<usize>

§

impl<'a, 'b> FindSubstring<&'b [u8]> for &'a [u8]

§

fn find_substring(&self, substr: &'b [u8]) -> Option<usize>

Implementors§