Skip to main content

ToParam

Trait ToParam 

Source
pub trait ToParam {
    // Required method
    fn to_param(&self) -> Value;
}
Expand description

Trait for types that can be converted to SQL parameters

This trait is automatically implemented for common Rust types. It enables the params! macro and tuple parameter syntax.

Platform-sized unsigned integers require an explicit checked conversion, because RadixDB integer parameters use the signed i64 domain:

use radixdb::ToParam;

let _ = usize::MAX.to_param();

Required Methods§

Source

fn to_param(&self) -> Value

Convert self into a Value for SQL parameter binding

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl ToParam for &str

Source§

fn to_param(&self) -> Value

Source§

impl ToParam for Arc<str>

Source§

fn to_param(&self) -> Value

Source§

impl ToParam for DateTime<Utc>

Source§

fn to_param(&self) -> Value

Source§

impl ToParam for NaiveDate

Source§

fn to_param(&self) -> Value

Source§

impl ToParam for String

Source§

fn to_param(&self) -> Value

Source§

impl ToParam for Uuid

Source§

fn to_param(&self) -> Value

Source§

impl ToParam for Value

Source§

fn to_param(&self) -> Value

Source§

impl ToParam for Value

Source§

fn to_param(&self) -> Value

Source§

impl ToParam for Vec<f32>

Source§

fn to_param(&self) -> Value

Source§

impl ToParam for Vec<u8>

Source§

fn to_param(&self) -> Value

Source§

impl ToParam for bool

Source§

fn to_param(&self) -> Value

Source§

impl ToParam for f32

Source§

fn to_param(&self) -> Value

Source§

impl ToParam for f64

Source§

fn to_param(&self) -> Value

Source§

impl ToParam for i8

Source§

fn to_param(&self) -> Value

Source§

impl ToParam for i16

Source§

fn to_param(&self) -> Value

Source§

impl ToParam for i32

Source§

fn to_param(&self) -> Value

Source§

impl ToParam for i64

Source§

fn to_param(&self) -> Value

Source§

impl ToParam for u8

Source§

fn to_param(&self) -> Value

Source§

impl ToParam for u16

Source§

fn to_param(&self) -> Value

Source§

impl ToParam for u32

Source§

fn to_param(&self) -> Value

Source§

impl<T: ToParam> ToParam for &T

Source§

fn to_param(&self) -> Value

Source§

impl<T: ToParam> ToParam for Option<T>

Source§

fn to_param(&self) -> Value

Implementors§