Trait like::Like

source · []
pub trait Like<const HAS_ESCAPE: bool> {
    type Err;
    fn like(&self, pattern: &Self) -> Result<bool, Self::Err>;

    fn not_like(&self, pattern: &Self) -> Result<bool, Self::Err> { ... }
}
Expand description

SQL like style pattern matching.

If pattern does not contain % or _, then the pattern only represents the pattern itself; in that case like acts like the equals operator. An underscore (_) in pattern stands for (matches) any single character; a percent sign (%) matches any sequence of zero or more characters.

Associated Types

The associated error which can be returned from pattern matching.

Required methods

Check if self match a pattern.

Returns true if self matches the supplied pattern.

Provided methods

Check if self match a pattern.

Returns true if self doesn’t match the supplied pattern.

Implementations on Foreign Types

Implementors