Trait Arguments

Source
pub trait Arguments<'q>:
    Sized
    + Send
    + Default {
    type Database: Database;

    // Required methods
    fn reserve(&mut self, additional: usize, size: usize);
    fn add<T>(&mut self, value: T) -> Result<(), Box<dyn Error + Sync + Send>>
       where T: 'q + Encode<'q, Self::Database> + Type<Self::Database>;
    fn len(&self) -> usize;

    // Provided method
    fn format_placeholder<W>(&self, writer: &mut W) -> Result<(), Error>
       where W: Write { ... }
}
Expand description

A tuple of arguments to be sent to the database.

Required Associated Types§

Required Methods§

Source

fn reserve(&mut self, additional: usize, size: usize)

Reserves the capacity for at least additional more values (of size total bytes) to be added to the arguments without a reallocation.

Source

fn add<T>(&mut self, value: T) -> Result<(), Box<dyn Error + Sync + Send>>
where T: 'q + Encode<'q, Self::Database> + Type<Self::Database>,

Add the value to the end of the arguments.

Source

fn len(&self) -> usize

The number of arguments that were already added.

Provided Methods§

Source

fn format_placeholder<W>(&self, writer: &mut W) -> Result<(), Error>
where W: Write,

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<'q> Arguments<'q> for SqliteArguments<'q>

Source§

type Database = Sqlite

Source§

fn reserve(&mut self, len: usize, _size_hint: usize)

Source§

fn add<T>(&mut self, value: T) -> Result<(), Box<dyn Error + Sync + Send>>
where T: Encode<'q, <SqliteArguments<'q> as Arguments<'q>>::Database>,

Source§

fn len(&self) -> usize

Implementors§