Trait winnow::stream::Compare

source ·
pub trait Compare<T> {
    // Required methods
    fn compare(&self, t: T) -> CompareResult;
    fn compare_no_case(&self, t: T) -> CompareResult;
}
Expand description

Abstracts comparison operations

Required Methods§

source

fn compare(&self, t: T) -> CompareResult

Compares self to another value for equality

source

fn compare_no_case(&self, t: T) -> CompareResult

Compares self to another value for equality independently of the case.

Warning: for &str, the comparison is done by lowercasing both strings and comparing the result. This is a temporary solution until a better one appears

Implementations on Foreign Types§

source§

impl<'a, 'b> Compare<&'b str> for &'a str

source§

impl<'a, 'b> Compare<&'b str> for &'a [u8]

source§

impl<'a, 'b> Compare<&'b [u8]> for &'a str

source§

fn compare(&self, t: &'b [u8]) -> CompareResult

source§

fn compare_no_case(&self, t: &'b [u8]) -> CompareResult

source§

impl<'a, 'b> Compare<&'b [u8]> for &'a [u8]

source§

fn compare(&self, t: &'b [u8]) -> CompareResult

source§

fn compare_no_case(&self, t: &'b [u8]) -> CompareResult

source§

impl<'a, 'b, const LEN: usize> Compare<&'b [u8; LEN]> for &'a [u8]

source§

fn compare(&self, t: &'b [u8; LEN]) -> CompareResult

source§

fn compare_no_case(&self, t: &'b [u8; LEN]) -> CompareResult

source§

impl<'a, const LEN: usize> Compare<[u8; LEN]> for &'a [u8]

Implementors§

source§

impl<'a, T> Compare<T> for &'a BStr
where &'a [u8]: Compare<T>,

source§

impl<'a, T> Compare<T> for &'a Bytes
where &'a [u8]: Compare<T>,

source§

impl<I, S, U> Compare<U> for Stateful<I, S>
where I: Compare<U>,

source§

impl<I, T> Compare<T> for Partial<I>
where I: Compare<T>,

source§

impl<I, U> Compare<U> for Located<I>
where I: Compare<U>,