[][src]Struct boyer_moore_magiclen::byte::BMByte

pub struct BMByte { /* fields omitted */ }

Using Boyer-Moore-MagicLen to search byte sub-sequences in any byte sequence, including self-synchronizing string encoding data such as UTF-8.

Methods

impl BMByte[src]

pub fn from<T: BMByteSearchable>(pattern: T) -> Option<BMByte>[src]

Create a BMByte instance from a pattern (the needle).

extern crate boyer_moore_magiclen;

use boyer_moore_magiclen::BMByte;

let bmb = BMByte::from("oocoo").unwrap();

impl BMByte[src]

pub fn find_full_all_in<T: BMByteSearchable>(&self, text: T) -> Vec<usize>[src]

Find and return the positions of all matched sub-sequences in any text (the haystack).

extern crate boyer_moore_magiclen;

use boyer_moore_magiclen::BMByte;

let bmb = BMByte::from("oocoo").unwrap();

assert_eq!(vec![1, 4, 7], bmb.find_full_all_in("coocoocoocoo"));

pub fn find_full_in<T: BMByteSearchable>(
    &self,
    text: T,
    limit: usize
) -> Vec<usize>
[src]

Find and return the positions of matched sub-sequences in any text (the haystack). If the limit is set to 0, all sub-sequences will be found.

extern crate boyer_moore_magiclen;

use boyer_moore_magiclen::BMByte;

let bmb = BMByte::from("oocoo").unwrap();

assert_eq!(vec![1, 4], bmb.find_full_in("coocoocoocoo", 2));

impl BMByte[src]

pub fn rfind_full_all_in<T: BMByteSearchable>(&self, text: T) -> Vec<usize>[src]

Find and return the positions of all matched sub-sequences in any text (the haystack) from its tail to its head.

extern crate boyer_moore_magiclen;

use boyer_moore_magiclen::BMByte;

let bmb = BMByte::from("oocoo").unwrap();

assert_eq!(vec![7, 4, 1], bmb.rfind_full_all_in("coocoocoocoo"));

pub fn rfind_full_in<T: BMByteSearchable>(
    &self,
    text: T,
    limit: usize
) -> Vec<usize>
[src]

Find and return the positions of matched sub-sequences in any text (the haystack) from its tail to its head. If the limit is set to 0, all sub-sequences will be found.

extern crate boyer_moore_magiclen;

use boyer_moore_magiclen::BMByte;

let bmb = BMByte::from("oocoo").unwrap();

assert_eq!(vec![7, 4], bmb.rfind_full_in("coocoocoocoo", 2));

impl BMByte[src]

pub fn find_all_in<T: BMByteSearchable>(&self, text: T) -> Vec<usize>[src]

Find and return the positions of all matched sub-sequences in any text (the haystack) but not including the overlap.

extern crate boyer_moore_magiclen;

use boyer_moore_magiclen::BMByte;

let bmb = BMByte::from("oocoo").unwrap();

assert_eq!(vec![1, 7], bmb.find_all_in("coocoocoocoo"));

pub fn find_first_in<T: BMByteSearchable>(&self, text: T) -> Option<usize>[src]

Find and return the position of the first matched sub-sequence in any text (the haystack).

extern crate boyer_moore_magiclen;

use boyer_moore_magiclen::BMByte;

let bmb = BMByte::from("oocoo").unwrap();

assert_eq!(Some(1), bmb.find_first_in("coocoocoocoo"));

pub fn find_in<T: BMByteSearchable>(&self, text: T, limit: usize) -> Vec<usize>[src]

Find and return the positions of matched sub-sequences in any text (the haystack) but not including the overlap. If the limit is set to 0, all sub-sequences will be found.

extern crate boyer_moore_magiclen;

use boyer_moore_magiclen::BMByte;

let bmb = BMByte::from("oocoo").unwrap();

assert_eq!(vec![1], bmb.find_in("coocoocoocoo", 1));

impl BMByte[src]

pub fn rfind_all_in<T: BMByteSearchable>(&self, text: T) -> Vec<usize>[src]

Find and return the positions of all matched sub-sequences in any text (the haystack) but not including the overlap from its tail to its head.

extern crate boyer_moore_magiclen;

use boyer_moore_magiclen::BMByte;

let bmb = BMByte::from("oocoo").unwrap();

assert_eq!(vec![7, 1], bmb.rfind_all_in("coocoocoocoo"));

pub fn rfind_first_in<T: BMByteSearchable>(&self, text: T) -> Option<usize>[src]

Find and return the position of the first matched sub-sequence in any text (the haystack) from its tail to its head.

extern crate boyer_moore_magiclen;

use boyer_moore_magiclen::BMByte;

let bmb = BMByte::from("oocoo").unwrap();

assert_eq!(Some(7), bmb.rfind_first_in("coocoocoocoo"));

pub fn rfind_in<T: BMByteSearchable>(&self, text: T, limit: usize) -> Vec<usize>[src]

Find and return the positions of matched sub-sequences in any text (the haystack) but not including the overlap from its tail to its head. If the limit is set to 0, all sub-sequences will be found.

extern crate boyer_moore_magiclen;

use boyer_moore_magiclen::BMByte;

let bmb = BMByte::from("oocoo").unwrap();

assert_eq!(vec![7], bmb.rfind_in("coocoocoocoo", 1));

Trait Implementations

impl Debug for BMByte[src]

Auto Trait Implementations

impl Send for BMByte

impl Sync for BMByte

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.