pub struct Bounded<B> { /* private fields */ }Expand description
A RelationalBackend whose every call is cut off after bound.
Implementations§
Trait Implementations§
Source§impl<B: RelationalBackend> RelationalBackend for Bounded<B>
impl<B: RelationalBackend> RelationalBackend for Bounded<B>
Source§type Tx<'a> = BoundedTx<<B as RelationalBackend>::Tx<'a>>
where
Self: 'a
type Tx<'a> = BoundedTx<<B as RelationalBackend>::Tx<'a>> where Self: 'a
A transaction on this backend. Dropping it without
commit rolls it back.Source§async fn execute(&self, sql: &str, params: &[Value]) -> Result<u64, RelError>
async fn execute(&self, sql: &str, params: &[Value]) -> Result<u64, RelError>
Run a statement that returns no rows; the result is the number of rows affected.
Source§async fn query(&self, sql: &str, params: &[Value]) -> Result<Vec<Row>, RelError>
async fn query(&self, sql: &str, params: &[Value]) -> Result<Vec<Row>, RelError>
Run a statement and return its rows.
Source§async fn begin(&self, isolation: Isolation) -> Result<Self::Tx<'_>, RelError>
async fn begin(&self, isolation: Isolation) -> Result<Self::Tx<'_>, RelError>
Begin a transaction at (at least)
isolation.Source§fn call_bound(&self) -> Option<Duration>
fn call_bound(&self) -> Option<Duration>
The per-call timeout this backend enforces, if one is configured;
None (the default) means a
call waits as long as the server does. Every call that takes longer returns
RelError::Timeout.Source§async fn with_lock_held<'a>(
&'a self,
lock_sql: &'a str,
at_most: Duration,
during: Pin<Box<dyn Future<Output = ()> + Send + 'a>>,
) -> Result<(), RelError>
async fn with_lock_held<'a>( &'a self, lock_sql: &'a str, at_most: Duration, during: Pin<Box<dyn Future<Output = ()> + Send + 'a>>, ) -> Result<(), RelError>
Test support for
kv.bounded_call: take lock_sql (a statement that locks a row) in a
transaction of its own, drive during while that lock is held, then roll back. during is
dropped, unfinished, after at_most, so a broken bound cannot hang the test. A backend that
enforces no bound returns RelError::Unsupported.Auto Trait Implementations§
impl<B> Freeze for Bounded<B>where
B: Freeze,
impl<B> RefUnwindSafe for Bounded<B>where
B: RefUnwindSafe,
impl<B> Send for Bounded<B>where
B: Send,
impl<B> Sync for Bounded<B>where
B: Sync,
impl<B> Unpin for Bounded<B>where
B: Unpin,
impl<B> UnsafeUnpin for Bounded<B>where
B: UnsafeUnpin,
impl<B> UnwindSafe for Bounded<B>where
B: UnwindSafe,
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