pub trait Execute<'q, DB: Database>: Send + Sized {
// Required methods
fn sql(&self) -> &'q str;
fn statement(&self) -> Option<&DB::Statement<'q>>;
fn take_arguments(
&mut self,
) -> Result<Option<<DB as Database>::Arguments<'q>>, BoxDynError>;
fn persistent(&self) -> bool;
}
Expand description
Required Methods§
sourcefn statement(&self) -> Option<&DB::Statement<'q>>
fn statement(&self) -> Option<&DB::Statement<'q>>
Gets the previously cached statement, if available.
sourcefn take_arguments(
&mut self,
) -> Result<Option<<DB as Database>::Arguments<'q>>, BoxDynError>
fn take_arguments( &mut self, ) -> Result<Option<<DB as Database>::Arguments<'q>>, BoxDynError>
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.