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§
sourcefn compare(&self, t: T) -> CompareResult
fn compare(&self, t: T) -> CompareResult
Compares self to another value for equality
sourcefn compare_no_case(&self, t: T) -> CompareResult
👎Deprecated since 0.5.20: Replaced with compare(ascii::Caseless(_))
fn compare_no_case(&self, t: T) -> CompareResult
compare(ascii::Caseless(_))
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> Compare<char> for &'a str
impl<'a> Compare<char> for &'a str
fn compare(&self, t: char) -> CompareResult
source§fn compare_no_case(&self, t: char) -> CompareResult
fn compare_no_case(&self, t: char) -> CompareResult
👎Deprecated since 0.5.20: Replaced with
compare(ascii::Caseless(_))
source§impl<'a> Compare<char> for &'a [u8]
impl<'a> Compare<char> for &'a [u8]
fn compare(&self, t: char) -> CompareResult
source§fn compare_no_case(&self, t: char) -> CompareResult
fn compare_no_case(&self, t: char) -> CompareResult
👎Deprecated since 0.5.20: Replaced with
compare(ascii::Caseless(_))
source§impl<'a> Compare<u8> for &'a str
impl<'a> Compare<u8> for &'a str
fn compare(&self, t: u8) -> CompareResult
source§fn compare_no_case(&self, t: u8) -> CompareResult
fn compare_no_case(&self, t: u8) -> CompareResult
👎Deprecated since 0.5.20: Replaced with
compare(ascii::Caseless(_))
source§impl<'a> Compare<u8> for &'a [u8]
impl<'a> Compare<u8> for &'a [u8]
fn compare(&self, t: u8) -> CompareResult
source§fn compare_no_case(&self, t: u8) -> CompareResult
fn compare_no_case(&self, t: u8) -> CompareResult
👎Deprecated since 0.5.20: Replaced with
compare(ascii::Caseless(_))
source§impl<'a> Compare<Caseless<char>> for &'a str
impl<'a> Compare<Caseless<char>> for &'a str
fn compare(&self, t: AsciiCaseless<char>) -> CompareResult
source§fn compare_no_case(&self, t: AsciiCaseless<char>) -> CompareResult
fn compare_no_case(&self, t: AsciiCaseless<char>) -> CompareResult
👎Deprecated since 0.5.20: Replaced with
compare(ascii::Caseless(_))
source§impl<'a> Compare<Caseless<char>> for &'a [u8]
impl<'a> Compare<Caseless<char>> for &'a [u8]
fn compare(&self, t: AsciiCaseless<char>) -> CompareResult
source§fn compare_no_case(&self, t: AsciiCaseless<char>) -> CompareResult
fn compare_no_case(&self, t: AsciiCaseless<char>) -> CompareResult
👎Deprecated since 0.5.20: Replaced with
compare(ascii::Caseless(_))
source§impl<'a> Compare<Caseless<u8>> for &'a str
impl<'a> Compare<Caseless<u8>> for &'a str
fn compare(&self, t: AsciiCaseless<u8>) -> CompareResult
source§fn compare_no_case(&self, t: AsciiCaseless<u8>) -> CompareResult
fn compare_no_case(&self, t: AsciiCaseless<u8>) -> CompareResult
👎Deprecated since 0.5.20: Replaced with
compare(ascii::Caseless(_))
source§impl<'a> Compare<Caseless<u8>> for &'a [u8]
impl<'a> Compare<Caseless<u8>> for &'a [u8]
fn compare(&self, t: AsciiCaseless<u8>) -> CompareResult
source§fn compare_no_case(&self, t: AsciiCaseless<u8>) -> CompareResult
fn compare_no_case(&self, t: AsciiCaseless<u8>) -> CompareResult
👎Deprecated since 0.5.20: Replaced with
compare(ascii::Caseless(_))
source§impl<'a, 'b> Compare<&'b str> for &'a str
impl<'a, 'b> Compare<&'b str> for &'a str
fn compare(&self, t: &'b str) -> CompareResult
source§fn compare_no_case(&self, t: &'b str) -> CompareResult
fn compare_no_case(&self, t: &'b str) -> CompareResult
👎Deprecated since 0.5.20: Replaced with
compare(ascii::Caseless(_))
source§impl<'a, 'b> Compare<&'b str> for &'a [u8]
impl<'a, 'b> Compare<&'b str> for &'a [u8]
fn compare(&self, t: &'b str) -> CompareResult
source§fn compare_no_case(&self, t: &'b str) -> CompareResult
fn compare_no_case(&self, t: &'b str) -> CompareResult
👎Deprecated since 0.5.20: Replaced with
compare(ascii::Caseless(_))
source§impl<'a, 'b> Compare<&'b [u8]> for &'a str
impl<'a, 'b> Compare<&'b [u8]> for &'a str
fn compare(&self, t: &'b [u8]) -> CompareResult
source§fn compare_no_case(&self, t: &'b [u8]) -> CompareResult
fn compare_no_case(&self, t: &'b [u8]) -> CompareResult
👎Deprecated since 0.5.20: Replaced with
compare(ascii::Caseless(_))
source§impl<'a, 'b> Compare<&'b [u8]> for &'a [u8]
impl<'a, 'b> Compare<&'b [u8]> for &'a [u8]
fn compare(&self, t: &'b [u8]) -> CompareResult
source§fn compare_no_case(&self, t: &'b [u8]) -> CompareResult
fn compare_no_case(&self, t: &'b [u8]) -> CompareResult
👎Deprecated since 0.5.20: Replaced with
compare(ascii::Caseless(_))
source§impl<'a, 'b> Compare<Caseless<&'b str>> for &'a str
impl<'a, 'b> Compare<Caseless<&'b str>> for &'a str
fn compare(&self, t: AsciiCaseless<&'b str>) -> CompareResult
source§fn compare_no_case(&self, t: AsciiCaseless<&'b str>) -> CompareResult
fn compare_no_case(&self, t: AsciiCaseless<&'b str>) -> CompareResult
👎Deprecated since 0.5.20: Replaced with
compare(ascii::Caseless(_))
source§impl<'a, 'b> Compare<Caseless<&'b str>> for &'a [u8]
impl<'a, 'b> Compare<Caseless<&'b str>> for &'a [u8]
fn compare(&self, t: AsciiCaseless<&'b str>) -> CompareResult
source§fn compare_no_case(&self, t: AsciiCaseless<&'b str>) -> CompareResult
fn compare_no_case(&self, t: AsciiCaseless<&'b str>) -> CompareResult
👎Deprecated since 0.5.20: Replaced with
compare(ascii::Caseless(_))
source§impl<'a, 'b> Compare<Caseless<&'b [u8]>> for &'a str
impl<'a, 'b> Compare<Caseless<&'b [u8]>> for &'a str
fn compare(&self, t: AsciiCaseless<&'b [u8]>) -> CompareResult
source§fn compare_no_case(&self, t: AsciiCaseless<&'b [u8]>) -> CompareResult
fn compare_no_case(&self, t: AsciiCaseless<&'b [u8]>) -> CompareResult
👎Deprecated since 0.5.20: Replaced with
compare(ascii::Caseless(_))
source§impl<'a, 'b> Compare<Caseless<&'b [u8]>> for &'a [u8]
impl<'a, 'b> Compare<Caseless<&'b [u8]>> for &'a [u8]
fn compare(&self, t: AsciiCaseless<&'b [u8]>) -> CompareResult
source§fn compare_no_case(&self, t: AsciiCaseless<&'b [u8]>) -> CompareResult
fn compare_no_case(&self, t: AsciiCaseless<&'b [u8]>) -> CompareResult
👎Deprecated since 0.5.20: Replaced with
compare(ascii::Caseless(_))
source§impl<'a, 'b, const LEN: usize> Compare<&'b [u8; LEN]> for &'a [u8]
impl<'a, 'b, const LEN: usize> Compare<&'b [u8; LEN]> for &'a [u8]
fn compare(&self, t: &'b [u8; LEN]) -> CompareResult
source§fn compare_no_case(&self, t: &'b [u8; LEN]) -> CompareResult
fn compare_no_case(&self, t: &'b [u8; LEN]) -> CompareResult
👎Deprecated since 0.5.20: Replaced with
compare(ascii::Caseless(_))
source§impl<'a, 'b, const LEN: usize> Compare<Caseless<&'b [u8; LEN]>> for &'a [u8]
impl<'a, 'b, const LEN: usize> Compare<Caseless<&'b [u8; LEN]>> for &'a [u8]
fn compare(&self, t: AsciiCaseless<&'b [u8; LEN]>) -> CompareResult
source§fn compare_no_case(&self, t: AsciiCaseless<&'b [u8; LEN]>) -> CompareResult
fn compare_no_case(&self, t: AsciiCaseless<&'b [u8; LEN]>) -> CompareResult
👎Deprecated since 0.5.20: Replaced with
compare(ascii::Caseless(_))
source§impl<'a, const LEN: usize> Compare<Caseless<[u8; LEN]>> for &'a [u8]
impl<'a, const LEN: usize> Compare<Caseless<[u8; LEN]>> for &'a [u8]
fn compare(&self, t: AsciiCaseless<[u8; LEN]>) -> CompareResult
source§fn compare_no_case(&self, t: AsciiCaseless<[u8; LEN]>) -> CompareResult
fn compare_no_case(&self, t: AsciiCaseless<[u8; LEN]>) -> CompareResult
👎Deprecated since 0.5.20: Replaced with
compare(ascii::Caseless(_))
source§impl<'a, const LEN: usize> Compare<[u8; LEN]> for &'a [u8]
impl<'a, const LEN: usize> Compare<[u8; LEN]> for &'a [u8]
fn compare(&self, t: [u8; LEN]) -> CompareResult
source§fn compare_no_case(&self, t: [u8; LEN]) -> CompareResult
fn compare_no_case(&self, t: [u8; LEN]) -> CompareResult
👎Deprecated since 0.5.20: Replaced with
compare(ascii::Caseless(_))