odbc_api

Trait ParameterCollection

Source
pub unsafe trait ParameterCollection {
    // Required methods
    fn parameter_set_size(&self) -> usize;
    unsafe fn bind_parameters_to(
        &mut self,
        stmt: &mut impl Statement,
    ) -> Result<(), Error>;
}
Expand description

Implementers of this trait can be bound to a statement through a self::ParameterCollectionRef.

§Safety

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

Required Methods§

Source

fn parameter_set_size(&self) -> usize

Number of values per parameter in the collection. This can be different from the maximum batch size a buffer may be able to hold. Returning 0 will cause the the query not to be executed.

Source

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

Bind the parameters to a statement

§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.

Implementors§

Source§

impl ParameterCollection for BlobParam<'_>

Source§

impl<T> ParameterCollection for T
where T: InputParameterCollection + ?Sized,