aho_corasick/packed/teddy/
mod.rs

1#[cfg(target_arch = "x86_64")]
2pub use crate::packed::teddy::compile::Builder;
3#[cfg(not(target_arch = "x86_64"))]
4pub use crate::packed::teddy::fallback::Builder;
5#[cfg(not(target_arch = "x86_64"))]
6pub use crate::packed::teddy::fallback::Teddy;
7#[cfg(target_arch = "x86_64")]
8pub use crate::packed::teddy::runtime::Teddy;
9
10#[cfg(target_arch = "x86_64")]
11mod compile;
12#[cfg(target_arch = "x86_64")]
13mod runtime;
14
15#[cfg(not(target_arch = "x86_64"))]
16mod fallback {
17    use crate::packed::pattern::Patterns;
18    use crate::Match;
19
20    #[derive(Clone, Debug, Default)]
21    pub struct Builder(());
22
23    impl Builder {
24        pub fn new() -> Builder {
25            Builder(())
26        }
27
28        pub fn build(&self, _: &Patterns) -> Option<Teddy> {
29            None
30        }
31
32        pub fn fat(&mut self, _: Option<bool>) -> &mut Builder {
33            self
34        }
35
36        pub fn avx(&mut self, _: Option<bool>) -> &mut Builder {
37            self
38        }
39    }
40
41    #[derive(Clone, Debug)]
42    pub struct Teddy(());
43
44    impl Teddy {
45        pub fn find_at(
46            &self,
47            _: &Patterns,
48            _: &[u8],
49            _: usize,
50        ) -> Option<Match> {
51            None
52        }
53
54        pub fn minimum_len(&self) -> usize {
55            0
56        }
57
58        pub fn heap_bytes(&self) -> usize {
59            0
60        }
61    }
62}