Skip to main content

InMemoryConnection

Struct InMemoryConnection 

Source
pub struct InMemoryConnection {
    pub executed: RefCell<Vec<ExecutedCommand>>,
    /* private fields */
}

Fields§

§executed: RefCell<Vec<ExecutedCommand>>

Implementations§

Source§

impl InMemoryConnection

Source

pub fn with_grids(grids: Vec<Vec<Row>>) -> Self

Source

pub fn with_affected(self, affected: usize) -> Self

Source

pub fn with_scalar(self, scalar: Value) -> Self

Trait Implementations§

Source§

impl Clone for InMemoryConnection

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Connection for InMemoryConnection

Source§

fn query_grids( &self, sql: &str, params: &Parameters, ) -> Result<Vec<Vec<Row>>, DbError>

Source§

fn execute(&mut self, sql: &str, params: &Parameters) -> Result<usize, DbError>

Source§

fn execute_scalar_value( &self, sql: &str, params: &Parameters, ) -> Result<Value, DbError>

Source§

impl Debug for InMemoryConnection

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<Q> Queryable for Q
where Q: Connection + ?Sized,

Source§

fn query<T: FromRow>(&self, sql: &str) -> Result<Vec<T>, MappingError>

Source§

fn query_with<T: FromRow>( &self, sql: &str, params: &Parameters, ) -> Result<Vec<T>, MappingError>

Source§

fn query_first<T: FromRow>(&self, sql: &str) -> Result<T, MappingError>

Source§

fn query_first_with<T: FromRow>( &self, sql: &str, params: &Parameters, ) -> Result<T, MappingError>

Source§

fn query_first_or_default<T: FromRow>( &self, sql: &str, ) -> Result<Option<T>, MappingError>

Source§

fn query_first_or_default_with<T: FromRow>( &self, sql: &str, params: &Parameters, ) -> Result<Option<T>, MappingError>

Source§

fn query_single<T: FromRow>(&self, sql: &str) -> Result<T, MappingError>

Source§

fn query_single_with<T: FromRow>( &self, sql: &str, params: &Parameters, ) -> Result<T, MappingError>

Source§

fn query_single_or_default<T: FromRow>( &self, sql: &str, ) -> Result<Option<T>, MappingError>

Source§

fn query_single_or_default_with<T: FromRow>( &self, sql: &str, params: &Parameters, ) -> Result<Option<T>, MappingError>

Source§

fn query_multiple(&self, sql: &str) -> Result<GridReader, MappingError>

Source§

fn query_multiple_with( &self, sql: &str, params: &Parameters, ) -> Result<GridReader, MappingError>

Source§

fn query_scalar<T: FromColumnScalar>( &self, sql: &str, ) -> Result<T, MappingError>

Source§

fn query_scalar_with<T: FromColumnScalar>( &self, sql: &str, params: &Parameters, ) -> Result<T, MappingError>

Source§

fn query_multi_map<T1: FromRow, T2: FromRow, R>( &self, sql: &str, split_on: &str, combine: impl Fn(T1, T2) -> R, ) -> Result<Vec<R>, MappingError>

Source§

fn query_multi_map_with<T1: FromRow, T2: FromRow, R>( &self, sql: &str, params: &Parameters, split_on: &str, combine: impl Fn(T1, T2) -> R, ) -> Result<Vec<R>, MappingError>

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.