pub struct MockDriver { /* private fields */ }Expand description
The Driver trait defines the interface for connecting to different data sources and executing
SQL queries.
Implementations§
Source§impl MockDriver
impl MockDriver
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() -> MockDriver
pub fn new() -> MockDriver
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 MockDriver
impl MockDriver
Sourcepub fn expect_identifier(&mut self) -> &mut Expectation
pub fn expect_identifier(&mut self) -> &mut Expectation
Create an Expectation for mocking the identifier method
Sourcepub fn expect_connect(&mut self) -> &mut Expectation
pub fn expect_connect(&mut self) -> &mut Expectation
Create an Expectation for mocking the connect method
Sourcepub fn expect_supports_file_type(&mut self) -> &mut Expectation
pub fn expect_supports_file_type(&mut self) -> &mut Expectation
Create an Expectation for mocking the supports_file_type method
Trait Implementations§
Source§impl Debug for MockDriver
impl Debug for MockDriver
Source§impl Default for MockDriver
impl Default for MockDriver
Source§fn default() -> MockDriver
fn default() -> MockDriver
Source§impl Driver for MockDriver
The Driver trait defines the interface for connecting to different data sources and executing
SQL queries.
impl Driver for MockDriver
The Driver trait defines the interface for connecting to different data sources and executing
SQL queries.
Source§fn identifier(&self) -> &'static str
fn identifier(&self) -> &'static str
Returns the identifier of the driver. The identifier is used as the scheme in the URL to identify the driver.
Source§fn connect<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Connection>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MockDriver: 'async_trait,
fn connect<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Connection>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MockDriver: 'async_trait,
Connects to the data source using the specified URL.
Source§fn supports_file_type(&self, file_type: &FileType) -> bool
fn supports_file_type(&self, file_type: &FileType) -> bool
Returns whether the driver supports the specified file type.
Auto Trait Implementations§
impl Freeze for MockDriver
impl RefUnwindSafe for MockDriver
impl Send for MockDriver
impl Sync for MockDriver
impl Unpin for MockDriver
impl UnsafeUnpin for MockDriver
impl UnwindSafe for MockDriver
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more