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 + Send + Sync>>;
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 + Send + Sync>>
fn take_arguments( &mut self, ) -> Result<Option<<DB as Database>::Arguments<'q>>, Box<dyn Error + Send + Sync>>
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.