pub trait Execute<'q, DB>: Sized + Sendwhere
DB: Database,{
// Required methods
fn sql(&self) -> &'q str;
fn statement(&self) -> Option<&<DB as Database>::Statement<'q>>;
fn take_arguments(
&mut self,
) -> Result<Option<<DB as Database>::Arguments<'q>>, Box<dyn Error + Sync + Send>>;
fn persistent(&self) -> bool;
}
Expand description
Required Methods§
sourcefn statement(&self) -> Option<&<DB as Database>::Statement<'q>>
fn statement(&self) -> Option<&<DB as Database>::Statement<'q>>
Gets the previously cached statement, if available.
sourcefn take_arguments(
&mut self,
) -> Result<Option<<DB as Database>::Arguments<'q>>, Box<dyn Error + Sync + Send>>
fn take_arguments( &mut self, ) -> Result<Option<<DB as Database>::Arguments<'q>>, Box<dyn Error + Sync + Send>>
Returns the arguments to be bound against the query string.
Returning Ok(None)
for Arguments
indicates to use a “simple” query protocol and to not
prepare the query. Returning Ok(Some(Default::default()))
is an empty arguments object that
will be prepared (and cached) before execution.
Returns Err
if encoding any of the arguments failed.
sourcefn persistent(&self) -> bool
fn persistent(&self) -> bool
Returns true
if the statement should be cached.
Object Safety§
This trait is not object safe.