Struct rsql_drivers::MockConnection
source · pub struct MockConnection { /* private fields */ }
Expand description
Connection to a database
Implementations§
source§impl MockConnection
impl MockConnection
sourcepub fn checkpoint(&mut self)
pub fn checkpoint(&mut self)
Validate that all current expectations for all methods have been satisfied, and discard them.
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new mock object with no expectations.
This method will not be generated if the real struct
already has a new
method. However, it will be
generated if the struct implements a trait with a new
method. The trait’s new
method can still be called
like <MockX as TraitY>::new
source§impl MockConnection
impl MockConnection
sourcepub fn expect_execute(&mut self) -> &mut Expectation
pub fn expect_execute(&mut self) -> &mut Expectation
Create an Expectation
for mocking the execute
method
sourcepub fn expect_metadata(&mut self) -> &mut Expectation
pub fn expect_metadata(&mut self) -> &mut Expectation
Create an Expectation
for mocking the metadata
method
sourcepub fn expect_query(&mut self) -> &mut Expectation
pub fn expect_query(&mut self) -> &mut Expectation
Create an Expectation
for mocking the query
method
sourcepub fn expect_close(&mut self) -> &mut Expectation
pub fn expect_close(&mut self) -> &mut Expectation
Create an Expectation
for mocking the close
method
Trait Implementations§
source§impl Connection for MockConnection
impl Connection for MockConnection
Connection to a database
fn execute<'life0, 'life1, 'async_trait>(
&'life0 mut self,
sql: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn metadata<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<Metadata>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn query<'life0, 'life1, 'async_trait>(
&'life0 mut self,
sql: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Box<dyn QueryResult>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn close<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
source§impl Debug for MockConnection
impl Debug for MockConnection
Auto Trait Implementations§
impl Freeze for MockConnection
impl RefUnwindSafe for MockConnection
impl Send for MockConnection
impl Sync for MockConnection
impl Unpin for MockConnection
impl UnwindSafe for MockConnection
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