Function xfind::rfind [−][src]
Expand description
Returns the index of the last occurrence of the given needle in the stream.
Examples
use std::io::{self, Cursor};
fn main() -> io::Result<()> {
let mut stream = Cursor::new(b"rusty rust");
let pos = xfind::rfind(b"rust", &mut stream).transpose()?;
assert_eq!(pos, Some(6));
Ok(())
}