pub struct MockCommand {
pub response: Mutex<Response>,
pub reader_rows: Mutex<Vec<Row>>,
pub execute_calls: Mutex<usize>,
pub execute_logs: Mutex<Vec<(String, Vec<Parameter>)>>,
pub reader_logs: Mutex<Vec<(String, Vec<Parameter>)>>,
/* private fields */
}Fields§
§response: Mutex<Response>§reader_rows: Mutex<Vec<Row>>§execute_calls: Mutex<usize>§execute_logs: Mutex<Vec<(String, Vec<Parameter>)>>§reader_logs: Mutex<Vec<(String, Vec<Parameter>)>>Implementations§
Source§impl MockCommand
impl MockCommand
pub fn new() -> Self
pub fn set_execute_error(&self, message: impl Into<String>)
pub fn set_reader_error(&self, message: impl Into<String>)
Trait Implementations§
Source§impl Command for MockCommand
impl Command for MockCommand
fn connection(&self) -> Arc<dyn Connection> ⓘ
fn add_middleware(&self, middleware: Arc<dyn CommandMiddleware>)
fn execute_reader_native<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
text: &'life1 Native,
parameters: Option<&'life2 [Parameter]>,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Reader>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn execute_reader_statement<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
statement: &'life1 dyn Statement,
parameters: Option<&'life2 [Parameter]>,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Reader>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn execute_native<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
text: &'life1 Native,
parameters: Option<&'life2 [Parameter]>,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn execute_reader<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
text: &'life1 str,
parameters: Option<&'life2 [Parameter]>,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Reader>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
text: &'life1 str,
parameters: Option<&'life2 [Parameter]>,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn execute_statement<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
statement: &'life1 dyn Statement,
parameters: Option<&'life2 [Parameter]>,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Auto Trait Implementations§
impl !Freeze for MockCommand
impl !RefUnwindSafe for MockCommand
impl !UnwindSafe for MockCommand
impl Forget for MockCommand
impl Send for MockCommand
impl Sync for MockCommand
impl Unpin for MockCommand
impl UnsafeUnpin for MockCommand
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more