1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use super::function_expr::BinaryFunction;
use super::*;
pub struct BinaryNameSpace(pub(crate) Expr);
impl BinaryNameSpace {
pub fn contains_literal<S: AsRef<[u8]>>(self, pat: S) -> Expr {
let pat = pat.as_ref().into();
self.0
.map_private(BinaryFunction::Contains { pat, literal: true }.into())
}
pub fn ends_with<S: AsRef<[u8]>>(self, sub: S) -> Expr {
let sub = sub.as_ref().into();
self.0.map_private(BinaryFunction::EndsWith(sub).into())
}
pub fn starts_with<S: AsRef<[u8]>>(self, sub: S) -> Expr {
let sub = sub.as_ref().into();
self.0.map_private(BinaryFunction::StartsWith(sub).into())
}
}