pub enum DbSource<'a> {
Pool(&'a DatabasePool),
Tx(&'a Transaction),
}Expand description
Sumber koneksi database: dapat berupa Pool koneksi atau Transaksi aktif.
Variants§
Pool(&'a DatabasePool)
Tx(&'a Transaction)
Implementations§
Source§impl<'a> DbSource<'a>
impl<'a> DbSource<'a>
pub fn kind(&self) -> DatabaseKind
pub fn prepare_sql(&self, sql: &str) -> String
Trait Implementations§
Source§impl<'a> From<&'a DatabasePool> for DbSource<'a>
impl<'a> From<&'a DatabasePool> for DbSource<'a>
Source§fn from(pool: &'a DatabasePool) -> DbSource<'a>
fn from(pool: &'a DatabasePool) -> DbSource<'a>
Converts to this type from the input type.
Source§impl<'a> From<&'a Transaction> for DbSource<'a>
impl<'a> From<&'a Transaction> for DbSource<'a>
Source§fn from(tx: &'a Transaction) -> DbSource<'a>
fn from(tx: &'a Transaction) -> DbSource<'a>
Converts to this type from the input type.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for DbSource<'a>
impl<'a> !UnwindSafe for DbSource<'a>
impl<'a> Forget for DbSource<'a>
impl<'a> Freeze for DbSource<'a>
impl<'a> Move for DbSource<'a>
impl<'a> Send for DbSource<'a>
impl<'a> Sync for DbSource<'a>
impl<'a> Unpin for DbSource<'a>
impl<'a> UnsafeUnpin for DbSource<'a>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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