[][src]Trait like::Like

pub trait Like {
    type Err;
    fn like(&self, pattern: &Self) -> Result<bool, Self::Err>;

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

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

type Err

The associated error which can be returned from pattern matching.

Loading content...

Required methods

fn like(&self, pattern: &Self) -> Result<bool, Self::Err>

Check if self match a pattern.

Returns true if self matches the supplied pattern.

Loading content...

Provided methods

fn not_like(&self, pattern: &Self) -> Result<bool, Self::Err>

Check if self match a pattern.

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

Loading content...

Implementations on Foreign Types

impl Like for str[src]

type Err = InvalidPatternError

impl Like for [u8][src]

type Err = InvalidPatternError

Loading content...

Implementors

Loading content...