Skip to main content

FilterNumber

Trait FilterNumber 

Source
pub trait FilterNumber:
    Sized
    + Send
    + Sync
    + 'static {
    type Value: IntoExpr<Self> + PartialOrd;

    // Required method
    fn parse(value: &str) -> Option<Self::Value>;
}
Expand description

A field type a NumberFilter compares: the integer types up to 64 bits, f32 and f64, and an Option of one.

The decimal types are left out: SQLite, MySQL and Turso store them as text, which compares 10.00 below 9.50.

Required Associated Types§

Source

type Value: IntoExpr<Self> + PartialOrd

The value the field compares against.

Required Methods§

Source

fn parse(value: &str) -> Option<Self::Value>

A submitted bound, or None when it is not a number of the type.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl FilterNumber for f32

Source§

impl FilterNumber for f64

Source§

impl FilterNumber for i8

Source§

type Value = i8

Source§

fn parse(value: &str) -> Option<i8>

Source§

impl FilterNumber for i16

Source§

impl FilterNumber for i32

Source§

impl FilterNumber for i64

Source§

impl FilterNumber for isize

Source§

impl FilterNumber for u8

Source§

type Value = u8

Source§

fn parse(value: &str) -> Option<u8>

Source§

impl FilterNumber for u16

Source§

impl FilterNumber for u32

Source§

impl FilterNumber for u64

Source§

impl FilterNumber for usize

Source§

impl<T> FilterNumber for Option<T>
where T: FilterNumber<Value = T> + IntoExpr<T> + PartialOrd,

Source§

type Value = T

Source§

fn parse(value: &str) -> Option<T>

Implementors§