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.
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.