pub struct LikeMatcher { /* private fields */ }Expand description
A compiled SQL LIKE pattern (07 §4 / filter.ts). % matches any byte
run, _ matches exactly one byte. Compiled once (the builder lowers the
literal pattern) and matched per row with a classic backtracking glob walk.
Collation / escape policy (WS05.1):
\escape is honoured, matching the SQL the builder emits (ESCAPE '\'):\%/\_/\\are the literal%/_/\. So memory and SQLite agree for patterns that escape a wildcard.- Case-sensitive
LIKEis byte-level; the SQLite leaf setsPRAGMA case_sensitive_like = ONso its bareLIKEagrees (both case-sensitive). ILIKEfolds ASCII-only (eq_ignore_ascii_case), which matches the bundled SQLite’slower()(no ICU) — so memory and SQLite agree on ASCII. Non-ASCII case folding is a documented limitation (both leave non-ASCII bytes unfolded); revisit only if a corpus needs UnicodeILIKE._is byte-level, not UTF-8-character-level (a deferred edge for non-ASCII single-char matches; the byte glob structure is correct and tested).
Implementations§
Source§impl LikeMatcher
impl LikeMatcher
Sourcepub fn compile(pattern: &[u8]) -> LikeMatcher
pub fn compile(pattern: &[u8]) -> LikeMatcher
Compile a LIKE pattern. Adjacent literal bytes coalesce into one Lit
run; runs of % collapse to a single Any.
Sourcepub fn compile_case_insensitive(pattern: &[u8]) -> LikeMatcher
pub fn compile_case_insensitive(pattern: &[u8]) -> LikeMatcher
Compile a case-insensitive LIKE pattern (ILIKE).
Auto Trait Implementations§
impl Freeze for LikeMatcher
impl RefUnwindSafe for LikeMatcher
impl Send for LikeMatcher
impl Sync for LikeMatcher
impl Unpin for LikeMatcher
impl UnsafeUnpin for LikeMatcher
impl UnwindSafe for LikeMatcher
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more