Trait Execute

Source
pub trait Execute<'q, DB>: Sized + Send
where DB: Database,
{ // Required methods fn sql(&self) -> &'q str; fn statement(&self) -> Option<&<DB as HasStatement<'q>>::Statement>; fn take_arguments(&mut self) -> Option<<DB as HasArguments<'q>>::Arguments>; fn persistent(&self) -> bool; }
Expand description

A type that may be executed against a database connection.

Implemented for the following:

Required Methodsยง

Source

fn sql(&self) -> &'q str

Gets the SQL that will be executed.

Source

fn statement(&self) -> Option<&<DB as HasStatement<'q>>::Statement>

Gets the previously cached statement, if available.

Source

fn take_arguments(&mut self) -> Option<<DB as HasArguments<'q>>::Arguments>

Returns the arguments to be bound against the query string.

Returning None for Arguments indicates to use a โ€œsimpleโ€ query protocol and to not prepare the query. Returning Some(Default::default()) is an empty arguments object that will be prepared (and cached) before execution.

Source

fn persistent(&self) -> bool

Returns true if the statement should be cached.

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, DB> Execute<'q, DB> for &'q str
where DB: Database,

Sourceยง

fn sql(&self) -> &'q str

Sourceยง

fn statement(&self) -> Option<&<DB as HasStatement<'q>>::Statement>

Sourceยง

fn take_arguments(&mut self) -> Option<<DB as HasArguments<'q>>::Arguments>

Sourceยง

fn persistent(&self) -> bool

Sourceยง

impl<'q, DB> Execute<'q, DB> for (&'q str, Option<<DB as HasArguments<'q>>::Arguments>)
where DB: Database,

Sourceยง

fn sql(&self) -> &'q str

Sourceยง

fn statement(&self) -> Option<&<DB as HasStatement<'q>>::Statement>

Sourceยง

fn take_arguments(&mut self) -> Option<<DB as HasArguments<'q>>::Arguments>

Sourceยง

fn persistent(&self) -> bool

Implementorsยง

Sourceยง

impl<'q, DB, A> Execute<'q, DB> for Query<'q, DB, A>
where DB: Database, A: Send + IntoArguments<'q, DB>,

Sourceยง

impl<'q, DB, F, A> Execute<'q, DB> for Map<'q, DB, F, A>
where F: Send, A: Send + IntoArguments<'q, DB>, DB: Database,

Sourceยง

impl<'q, DB, O, A> Execute<'q, DB> for QueryAs<'q, DB, O, A>
where DB: Database, O: Send, A: Send + 'q + IntoArguments<'q, DB>,

Sourceยง

impl<'q, DB, O, A> Execute<'q, DB> for QueryScalar<'q, DB, O, A>
where DB: Database, O: Send, A: Send + 'q + IntoArguments<'q, DB>,