odbc_api

Trait ParameterTupleElement

Source
pub unsafe trait ParameterTupleElement {
    // Required method
    unsafe fn bind_to(
        &mut self,
        parameter_number: u16,
        stmt: &mut impl Statement,
    ) -> Result<(), Error>;
}
Expand description

Implementers of this trait can be used as individual parameters of in a tuple of parameter references. This includes input parameters, output or in/out parameters.

§Safety

Parameters bound to the statement must remain valid for the lifetime of the instance.

Required Methods§

Source

unsafe fn bind_to( &mut self, parameter_number: u16, stmt: &mut impl Statement, ) -> Result<(), Error>

Bind the parameter in question to a specific parameter_number.

§Safety

Since the parameter is now bound to stmt callers must take care that it is ensured that the parameter remains valid while it is used. If the parameter is bound as an output parameter it must also be ensured that it is exclusively referenced by statement.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T> ParameterTupleElement for &T
where T: InputParameter + ?Sized,

Bind immutable references as input parameters.

Source§

unsafe fn bind_to( &mut self, parameter_number: u16, stmt: &mut impl Statement, ) -> Result<(), Error>

Implementors§

Source§

impl ParameterTupleElement for &mut BlobParam<'_>

Source§

impl<'a, T> ParameterTupleElement for InOut<'a, T>

Bind mutable references as input/output parameter.

Source§

impl<'a, T> ParameterTupleElement for Out<'a, T>
where T: OutputParameter,

Mutable references wrapped in Out are bound as output parameters.