Skip to main content

ToFilterValue

Trait ToFilterValue 

Source
pub trait ToFilterValue {
    // Required method
    fn to_filter_value(&self) -> FilterValue;
}
Expand description

Reverse of crate::row::FromColumn: convert an in-memory value to a FilterValue suitable for parameter binding.

Used by the relation executor and crate::traits::ModelWithPk to project a fetched row’s primary/foreign key into a placeholder value without going through the From<T> path (which consumes the value).

§Intentional omissions

u64 is omitted by design: From<u64> panics on overflow, but to_filter_value(&self) takes a borrow and cannot recover or fail gracefully without hidden clamping. Callers with u64 primary keys should cast explicitly ((self.id as i64).to_filter_value()) or use FilterValue::String(self.id.to_string()) when full range preservation matters.

Required Methods§

Source

fn to_filter_value(&self) -> FilterValue

Convert this value to a FilterValue by borrowing.

Implementations on Foreign Types§

Source§

impl ToFilterValue for Value

Source§

impl ToFilterValue for bool

Source§

impl ToFilterValue for f32

Source§

impl ToFilterValue for f64

Source§

impl ToFilterValue for i8

Source§

impl ToFilterValue for i16

Source§

impl ToFilterValue for i32

Source§

impl ToFilterValue for i64

Source§

impl ToFilterValue for str

Source§

impl ToFilterValue for u8

Source§

impl ToFilterValue for u16

Source§

impl ToFilterValue for u32

Source§

impl ToFilterValue for String

Source§

impl ToFilterValue for Vec<u8>

Source§

impl ToFilterValue for DateTime<Utc>

Source§

impl ToFilterValue for NaiveDate

Source§

impl ToFilterValue for NaiveDateTime

Source§

impl ToFilterValue for NaiveTime

Source§

impl ToFilterValue for Decimal

Source§

impl ToFilterValue for Uuid

Source§

impl<T: ToFilterValue> ToFilterValue for Option<T>

Implementors§