Struct teddy::Teddy
[−]
[src]
pub struct Teddy;
A SIMD accelerated multi substring searcher.
Methods
impl Teddy
[src]
fn new<'a, I>(_pats: I) -> Option<Teddy> where I: IntoIterator<Item=&'a [u8]>
Create a new Teddy
multi substring matcher.
If a Teddy
matcher could not be created (i.e., pats
is empty or has
an empty substring), then None
is returned.
Warning
If teddy
was built without SIMD support, then this method will always return None
.
See the README for more information on how to compile teddy
with SIMD support.
fn patterns(&self) -> &[Vec<u8>]
Returns all of the substrings matched by this Teddy
.
fn approximate_size(&self) -> usize
Returns the approximate size on the heap used by this matcher.
fn find(&self, _haystack: &[u8]) -> Option<Match>
Searches haystack
for the substrings in this Teddy
. Returns the first match if one
exists, and otherwise None
.
fn is_accelerated() -> bool
Were we compiled with SIMD support? If not, Teddy::new
will always just return None
.
See the README for more information on how to compile teddy
with SIMD support.
Trait Implementations
impl Clone for Teddy
[src]
fn clone(&self) -> Teddy
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more