pub struct MockSurrealEngine { /* private fields */ }Expand description
A mock SurrealDB engine that requires exact matching of requests
Implementations§
Source§impl MockSurrealEngine
impl MockSurrealEngine
Sourcepub fn with_debug(self, debug: bool) -> Self
pub fn with_debug(self, debug: bool) -> Self
Enable debug logging of queries
Sourcepub fn with_exact_response(
self,
method: impl Into<String>,
params: Value,
response: Value,
) -> Self
pub fn with_exact_response( self, method: impl Into<String>, params: Value, response: Value, ) -> Self
Add an exact response for a specific method and parameters
Sourcepub fn with_method_response(
self,
method: impl Into<String>,
response: Value,
) -> Self
pub fn with_method_response( self, method: impl Into<String>, response: Value, ) -> Self
Add a response for a method with empty parameters
Sourcepub fn with_query_response(
self,
query: impl Into<String>,
response: Value,
) -> Self
pub fn with_query_response( self, query: impl Into<String>, response: Value, ) -> Self
Add a response for a query method with specific query string
Trait Implementations§
Source§impl Clone for MockSurrealEngine
impl Clone for MockSurrealEngine
Source§fn clone(&self) -> MockSurrealEngine
fn clone(&self) -> MockSurrealEngine
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MockSurrealEngine
impl Debug for MockSurrealEngine
Source§impl Default for MockSurrealEngine
impl Default for MockSurrealEngine
Source§impl Engine for MockSurrealEngine
impl Engine for MockSurrealEngine
fn send_message<'life0, 'life1, 'async_trait>(
&'life0 mut self,
method: &'life1 str,
params: Value,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send_message_cbor<'life0, 'life1, 'async_trait>(
&'life0 mut self,
method: &'life1 str,
params: CborValue,
) -> Pin<Box<dyn Future<Output = Result<CborValue>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Auto Trait Implementations§
impl Freeze for MockSurrealEngine
impl RefUnwindSafe for MockSurrealEngine
impl Send for MockSurrealEngine
impl Sync for MockSurrealEngine
impl Unpin for MockSurrealEngine
impl UnsafeUnpin for MockSurrealEngine
impl UnwindSafe for MockSurrealEngine
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