pub struct CompiledLikePattern { /* private fields */ }Expand description
A LIKE/ILIKE pattern compiled once for repeated evaluation. ASCII values use a byte matcher; Unicode retains character-oriented _ semantics. ILIKE matches the input collation’s lowercase forms of the input and of the whole pattern, as PostgreSQL’s Generic_Text_IC_like does.
Implementations§
Source§impl CompiledLikePattern
impl CompiledLikePattern
Sourcepub fn from_value_with_escape_with_control(
pattern: &Value,
case_insensitive: bool,
escape: Option<&Value>,
collation: u32,
control: &ProductionControl<'_>,
) -> Result<Self>
pub fn from_value_with_escape_with_control( pattern: &Value, case_insensitive: bool, escape: Option<&Value>, collation: u32, control: &ProductionControl<'_>, ) -> Result<Self>
Compile the selected text or bytea pattern without converting binary data to display text. collation is the call’s input collation: a text pattern requires a determinate one, and ILIKE maps case through its provider. Bytea patterns have no collation.
pub fn with_escape( pattern: &str, case_insensitive: bool, escape: Option<&str>, collation: u32, ) -> Result<Self>
Sourcepub fn with_escape_with_control(
pattern: &str,
case_insensitive: bool,
escape: Option<&str>,
collation: u32,
control: &ProductionControl<'_>,
) -> Result<Self>
pub fn with_escape_with_control( pattern: &str, case_insensitive: bool, escape: Option<&str>, collation: u32, control: &ProductionControl<'_>, ) -> Result<Self>
Compile while keeping each native token buffer under the supplied owner. ILIKE lowercases the pattern after rewriting it to the backslash escape, as PostgreSQL lowercases the result of like_escape.
pub fn try_is_match(&self, haystack: &str) -> Result<bool>
pub fn try_is_match_with_control( &self, haystack: &str, control: &ProductionControl<'_>, ) -> Result<bool>
pub fn try_matches_value(&self, haystack: &Value) -> Result<bool>
pub fn try_matches_value_with_control( &self, haystack: &Value, control: &ProductionControl<'_>, ) -> Result<bool>
Auto Trait Implementations§
impl Freeze for CompiledLikePattern
impl RefUnwindSafe for CompiledLikePattern
impl Send for CompiledLikePattern
impl Sync for CompiledLikePattern
impl Unpin for CompiledLikePattern
impl UnsafeUnpin for CompiledLikePattern
impl UnwindSafe for CompiledLikePattern
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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more