pub struct ProxyDatabaseConnection { /* private fields */ }
Expand description
Defines a connection for the [ProxyDatabase]
Implementationsยง
Sourceยงimpl ProxyDatabaseConnection
impl ProxyDatabaseConnection
Sourcepub fn new(
db_backend: DbBackend,
funcs: Arc<Box<dyn ProxyDatabaseTrait>>,
) -> Self
pub fn new( db_backend: DbBackend, funcs: Arc<Box<dyn ProxyDatabaseTrait>>, ) -> Self
Create a connection to the [ProxyDatabase]
Sourcepub fn get_database_backend(&self) -> DbBackend
pub fn get_database_backend(&self) -> DbBackend
Get the DatabaseBackend being used by the [ProxyDatabase]
Sourcepub async fn execute(&self, statement: Statement) -> Result<ExecResult, DbErr>
pub async fn execute(&self, statement: Statement) -> Result<ExecResult, DbErr>
Execute the SQL statement in the [ProxyDatabase]
Sourcepub async fn query_one(
&self,
statement: Statement,
) -> Result<Option<QueryResult>, DbErr>
pub async fn query_one( &self, statement: Statement, ) -> Result<Option<QueryResult>, DbErr>
Return one QueryResult if the query was successful
Sourcepub async fn query_all(
&self,
statement: Statement,
) -> Result<Vec<QueryResult>, DbErr>
pub async fn query_all( &self, statement: Statement, ) -> Result<Vec<QueryResult>, DbErr>
Return all QueryResults if the query was successful
Trait Implementationsยง
Auto Trait Implementationsยง
impl Freeze for ProxyDatabaseConnection
impl !RefUnwindSafe for ProxyDatabaseConnection
impl Send for ProxyDatabaseConnection
impl Sync for ProxyDatabaseConnection
impl Unpin for ProxyDatabaseConnection
impl !UnwindSafe for ProxyDatabaseConnection
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
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>
Converts
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>
Converts
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