Skip to main content

SqlParam

Trait SqlParam 

Source
pub trait SqlParam {
    // Required method
    fn encode(&self) -> Vec<u8> ;
}
Expand description

Trait for types that can be encoded as SQL prepared statement parameters.

This trait enables the [params!] macro to automatically encode values. All implementations use #[inline] for zero-cost abstraction.

Required Methods§

Source

fn encode(&self) -> Vec<u8>

Encodes the value as binary bytes.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl SqlParam for &String

Source§

fn encode(&self) -> Vec<u8>

Source§

impl SqlParam for &[u8]

Source§

fn encode(&self) -> Vec<u8>

Source§

impl SqlParam for &str

Source§

fn encode(&self) -> Vec<u8>

Source§

impl SqlParam for String

Source§

fn encode(&self) -> Vec<u8>

Source§

impl SqlParam for Vec<u8>

Source§

fn encode(&self) -> Vec<u8>

Source§

impl SqlParam for bool

Source§

fn encode(&self) -> Vec<u8>

Source§

impl SqlParam for f32

Source§

fn encode(&self) -> Vec<u8>

Source§

impl SqlParam for f64

Source§

fn encode(&self) -> Vec<u8>

Source§

impl SqlParam for i16

Source§

fn encode(&self) -> Vec<u8>

Source§

impl SqlParam for i32

Source§

fn encode(&self) -> Vec<u8>

Source§

impl SqlParam for i64

Source§

fn encode(&self) -> Vec<u8>

Implementors§