MCPcopy Create free account
hub / github.com/ashvardanian/StringZilla / find

Method find

rust/stringzilla.rs:2449–2458  ·  view source on GitHub ↗
(&self, haystack: &'a [u8])

Source from the content-addressed store, hash-verified

2447
2448impl<'a> Matcher<'a> for MatcherType<'a> {
2449 fn find(&self, haystack: &'a [u8]) -> Option<usize> {
2450 match self {
2451 MatcherType::Find(needle) => find(haystack, needle),
2452 MatcherType::RFind(needle) => rfind(haystack, needle),
2453 MatcherType::FindFirstOf(needles) => find_byte_from(haystack, needles),
2454 MatcherType::FindLastOf(needles) => rfind_byte_from(haystack, needles),
2455 MatcherType::FindFirstNotOf(needles) => find_byte_not_from(haystack, needles),
2456 MatcherType::FindLastNotOf(needles) => rfind_byte_not_from(haystack, needles),
2457 }
2458 }
2459
2460 fn needle_length(&self) -> usize {
2461 match self {

Callers 1

nextMethod · 0.45

Calls 6

findFunction · 0.85
rfindFunction · 0.85
find_byte_fromFunction · 0.85
rfind_byte_fromFunction · 0.85
find_byte_not_fromFunction · 0.85
rfind_byte_not_fromFunction · 0.85

Tested by

no test coverage detected