ToParams

Trait ToParams 

Source
pub trait ToParams {
    // Required methods
    fn param_count(&self) -> usize;
    fn natural_oids(&self) -> Vec<Oid> ;
    fn encode(&self, target_oids: &[Oid], buf: &mut Vec<u8>) -> Result<()>;
}
Expand description

Trait for encoding multiple parameters.

Required Methods§

Source

fn param_count(&self) -> usize

Number of parameters.

Source

fn natural_oids(&self) -> Vec<Oid>

Get natural OIDs for all parameters (for exec_* with SQL string).

Source

fn encode(&self, target_oids: &[Oid], buf: &mut Vec<u8>) -> Result<()>

Encode all parameters using specified target OIDs.

The target_oids slice must have the same length as param_count(). Each parameter is encoded using its preferred format based on the OID.

Implementations on Foreign Types§

Source§

impl ToParams for ()

Source§

fn param_count(&self) -> usize

Source§

fn natural_oids(&self) -> Vec<Oid>

Source§

fn encode(&self, _target_oids: &[Oid], _buf: &mut Vec<u8>) -> Result<()>

Source§

impl<T0: ToWireValue> ToParams for (T0,)

Source§

fn param_count(&self) -> usize

Source§

fn natural_oids(&self) -> Vec<Oid>

Source§

fn encode(&self, target_oids: &[Oid], buf: &mut Vec<u8>) -> Result<()>

Source§

impl<T0: ToWireValue, T1: ToWireValue> ToParams for (T0, T1)

Source§

fn param_count(&self) -> usize

Source§

fn natural_oids(&self) -> Vec<Oid>

Source§

fn encode(&self, target_oids: &[Oid], buf: &mut Vec<u8>) -> Result<()>

Source§

impl<T0: ToWireValue, T1: ToWireValue, T2: ToWireValue> ToParams for (T0, T1, T2)

Source§

fn param_count(&self) -> usize

Source§

fn natural_oids(&self) -> Vec<Oid>

Source§

fn encode(&self, target_oids: &[Oid], buf: &mut Vec<u8>) -> Result<()>

Source§

impl<T0: ToWireValue, T1: ToWireValue, T2: ToWireValue, T3: ToWireValue> ToParams for (T0, T1, T2, T3)

Source§

fn param_count(&self) -> usize

Source§

fn natural_oids(&self) -> Vec<Oid>

Source§

fn encode(&self, target_oids: &[Oid], buf: &mut Vec<u8>) -> Result<()>

Source§

impl<T0: ToWireValue, T1: ToWireValue, T2: ToWireValue, T3: ToWireValue, T4: ToWireValue> ToParams for (T0, T1, T2, T3, T4)

Source§

fn param_count(&self) -> usize

Source§

fn natural_oids(&self) -> Vec<Oid>

Source§

fn encode(&self, target_oids: &[Oid], buf: &mut Vec<u8>) -> Result<()>

Source§

impl<T0: ToWireValue, T1: ToWireValue, T2: ToWireValue, T3: ToWireValue, T4: ToWireValue, T5: ToWireValue> ToParams for (T0, T1, T2, T3, T4, T5)

Source§

fn param_count(&self) -> usize

Source§

fn natural_oids(&self) -> Vec<Oid>

Source§

fn encode(&self, target_oids: &[Oid], buf: &mut Vec<u8>) -> Result<()>

Source§

impl<T0: ToWireValue, T1: ToWireValue, T2: ToWireValue, T3: ToWireValue, T4: ToWireValue, T5: ToWireValue, T6: ToWireValue> ToParams for (T0, T1, T2, T3, T4, T5, T6)

Source§

fn param_count(&self) -> usize

Source§

fn natural_oids(&self) -> Vec<Oid>

Source§

fn encode(&self, target_oids: &[Oid], buf: &mut Vec<u8>) -> Result<()>

Source§

impl<T0: ToWireValue, T1: ToWireValue, T2: ToWireValue, T3: ToWireValue, T4: ToWireValue, T5: ToWireValue, T6: ToWireValue, T7: ToWireValue> ToParams for (T0, T1, T2, T3, T4, T5, T6, T7)

Source§

fn param_count(&self) -> usize

Source§

fn natural_oids(&self) -> Vec<Oid>

Source§

fn encode(&self, target_oids: &[Oid], buf: &mut Vec<u8>) -> Result<()>

Source§

impl<T0: ToWireValue, T1: ToWireValue, T2: ToWireValue, T3: ToWireValue, T4: ToWireValue, T5: ToWireValue, T6: ToWireValue, T7: ToWireValue, T8: ToWireValue> ToParams for (T0, T1, T2, T3, T4, T5, T6, T7, T8)

Source§

fn param_count(&self) -> usize

Source§

fn natural_oids(&self) -> Vec<Oid>

Source§

fn encode(&self, target_oids: &[Oid], buf: &mut Vec<u8>) -> Result<()>

Source§

impl<T0: ToWireValue, T1: ToWireValue, T2: ToWireValue, T3: ToWireValue, T4: ToWireValue, T5: ToWireValue, T6: ToWireValue, T7: ToWireValue, T8: ToWireValue, T9: ToWireValue> ToParams for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)

Source§

fn param_count(&self) -> usize

Source§

fn natural_oids(&self) -> Vec<Oid>

Source§

fn encode(&self, target_oids: &[Oid], buf: &mut Vec<u8>) -> Result<()>

Source§

impl<T0: ToWireValue, T1: ToWireValue, T2: ToWireValue, T3: ToWireValue, T4: ToWireValue, T5: ToWireValue, T6: ToWireValue, T7: ToWireValue, T8: ToWireValue, T9: ToWireValue, T10: ToWireValue> ToParams for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)

Source§

fn param_count(&self) -> usize

Source§

fn natural_oids(&self) -> Vec<Oid>

Source§

fn encode(&self, target_oids: &[Oid], buf: &mut Vec<u8>) -> Result<()>

Source§

impl<T0: ToWireValue, T1: ToWireValue, T2: ToWireValue, T3: ToWireValue, T4: ToWireValue, T5: ToWireValue, T6: ToWireValue, T7: ToWireValue, T8: ToWireValue, T9: ToWireValue, T10: ToWireValue, T11: ToWireValue> ToParams for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)

Source§

fn param_count(&self) -> usize

Source§

fn natural_oids(&self) -> Vec<Oid>

Source§

fn encode(&self, target_oids: &[Oid], buf: &mut Vec<u8>) -> Result<()>

Source§

impl<T: ToParams + ?Sized> ToParams for &T

Source§

fn param_count(&self) -> usize

Source§

fn natural_oids(&self) -> Vec<Oid>

Source§

fn encode(&self, target_oids: &[Oid], buf: &mut Vec<u8>) -> Result<()>

Implementors§