PredicateValue

Trait PredicateValue 

Source
pub trait PredicateValue: Clone {
    type Borrowed<'a>: ?Sized
       where Self: 'a;

    // Required methods
    fn borrowed(value: &Self) -> &Self::Borrowed<'_>;
    fn equals(value: &Self::Borrowed<'_>, target: &Self) -> bool;
    fn compare(value: &Self::Borrowed<'_>, target: &Self) -> Option<Ordering>;

    // Provided methods
    fn contains(
        value: &Self::Borrowed<'_>,
        target: &Self,
        case_sensitive: bool,
    ) -> bool { ... }
    fn starts_with(
        value: &Self::Borrowed<'_>,
        target: &Self,
        case_sensitive: bool,
    ) -> bool { ... }
    fn ends_with(
        value: &Self::Borrowed<'_>,
        target: &Self,
        case_sensitive: bool,
    ) -> bool { ... }
}
Expand description

Value that can participate in typed predicate evaluation.

Required Associated Types§

Source

type Borrowed<'a>: ?Sized where Self: 'a

Required Methods§

Source

fn borrowed(value: &Self) -> &Self::Borrowed<'_>

Source

fn equals(value: &Self::Borrowed<'_>, target: &Self) -> bool

Source

fn compare(value: &Self::Borrowed<'_>, target: &Self) -> Option<Ordering>

Provided Methods§

Source

fn contains( value: &Self::Borrowed<'_>, target: &Self, case_sensitive: bool, ) -> bool

Source

fn starts_with( value: &Self::Borrowed<'_>, target: &Self, case_sensitive: bool, ) -> bool

Source

fn ends_with( value: &Self::Borrowed<'_>, target: &Self, case_sensitive: bool, ) -> bool

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl PredicateValue for bool

Source§

type Borrowed<'a> = bool where Self: 'a

Source§

fn borrowed(value: &Self) -> &Self::Borrowed<'_>

Source§

fn equals(value: &Self::Borrowed<'_>, target: &Self) -> bool

Source§

fn compare(value: &Self::Borrowed<'_>, target: &Self) -> Option<Ordering>

Source§

impl PredicateValue for f32

Source§

type Borrowed<'a> = f32 where Self: 'a

Source§

fn borrowed(value: &Self) -> &Self::Borrowed<'_>

Source§

fn equals(value: &Self::Borrowed<'_>, target: &Self) -> bool

Source§

fn compare(value: &Self::Borrowed<'_>, target: &Self) -> Option<Ordering>

Source§

impl PredicateValue for f64

Source§

type Borrowed<'a> = f64 where Self: 'a

Source§

fn borrowed(value: &Self) -> &Self::Borrowed<'_>

Source§

fn equals(value: &Self::Borrowed<'_>, target: &Self) -> bool

Source§

fn compare(value: &Self::Borrowed<'_>, target: &Self) -> Option<Ordering>

Source§

impl PredicateValue for i8

Source§

type Borrowed<'a> = i8 where Self: 'a

Source§

fn borrowed(value: &Self) -> &Self::Borrowed<'_>

Source§

fn equals(value: &Self::Borrowed<'_>, target: &Self) -> bool

Source§

fn compare(value: &Self::Borrowed<'_>, target: &Self) -> Option<Ordering>

Source§

impl PredicateValue for i16

Source§

type Borrowed<'a> = i16 where Self: 'a

Source§

fn borrowed(value: &Self) -> &Self::Borrowed<'_>

Source§

fn equals(value: &Self::Borrowed<'_>, target: &Self) -> bool

Source§

fn compare(value: &Self::Borrowed<'_>, target: &Self) -> Option<Ordering>

Source§

impl PredicateValue for i32

Source§

type Borrowed<'a> = i32 where Self: 'a

Source§

fn borrowed(value: &Self) -> &Self::Borrowed<'_>

Source§

fn equals(value: &Self::Borrowed<'_>, target: &Self) -> bool

Source§

fn compare(value: &Self::Borrowed<'_>, target: &Self) -> Option<Ordering>

Source§

impl PredicateValue for i64

Source§

type Borrowed<'a> = i64 where Self: 'a

Source§

fn borrowed(value: &Self) -> &Self::Borrowed<'_>

Source§

fn equals(value: &Self::Borrowed<'_>, target: &Self) -> bool

Source§

fn compare(value: &Self::Borrowed<'_>, target: &Self) -> Option<Ordering>

Source§

impl PredicateValue for u8

Source§

type Borrowed<'a> = u8 where Self: 'a

Source§

fn borrowed(value: &Self) -> &Self::Borrowed<'_>

Source§

fn equals(value: &Self::Borrowed<'_>, target: &Self) -> bool

Source§

fn compare(value: &Self::Borrowed<'_>, target: &Self) -> Option<Ordering>

Source§

impl PredicateValue for u16

Source§

type Borrowed<'a> = u16 where Self: 'a

Source§

fn borrowed(value: &Self) -> &Self::Borrowed<'_>

Source§

fn equals(value: &Self::Borrowed<'_>, target: &Self) -> bool

Source§

fn compare(value: &Self::Borrowed<'_>, target: &Self) -> Option<Ordering>

Source§

impl PredicateValue for u32

Source§

type Borrowed<'a> = u32 where Self: 'a

Source§

fn borrowed(value: &Self) -> &Self::Borrowed<'_>

Source§

fn equals(value: &Self::Borrowed<'_>, target: &Self) -> bool

Source§

fn compare(value: &Self::Borrowed<'_>, target: &Self) -> Option<Ordering>

Source§

impl PredicateValue for u64

Source§

type Borrowed<'a> = u64 where Self: 'a

Source§

fn borrowed(value: &Self) -> &Self::Borrowed<'_>

Source§

fn equals(value: &Self::Borrowed<'_>, target: &Self) -> bool

Source§

fn compare(value: &Self::Borrowed<'_>, target: &Self) -> Option<Ordering>

Source§

impl PredicateValue for String

Source§

type Borrowed<'a> = str where Self: 'a

Source§

fn borrowed(value: &Self) -> &Self::Borrowed<'_>

Source§

fn equals(value: &Self::Borrowed<'_>, target: &Self) -> bool

Source§

fn compare(value: &Self::Borrowed<'_>, target: &Self) -> Option<Ordering>

Source§

fn contains( value: &Self::Borrowed<'_>, target: &Self, case_sensitive: bool, ) -> bool

Source§

fn starts_with( value: &Self::Borrowed<'_>, target: &Self, case_sensitive: bool, ) -> bool

Source§

fn ends_with( value: &Self::Borrowed<'_>, target: &Self, case_sensitive: bool, ) -> bool

Implementors§