Enum deadpool_diesel::Runtime
source · pub enum Runtime {
Tokio1,
AsyncStd1,
}
Expand description
Enumeration for picking a runtime implementation.
Variants§
Implementations§
source§impl Runtime
impl Runtime
sourcepub async fn timeout<F>(
&self,
duration: Duration,
future: F
) -> Option<<F as Future>::Output>where
F: Future,
Available on crate feature mysql
only.
pub async fn timeout<F>(
&self,
duration: Duration,
future: F
) -> Option<<F as Future>::Output>where
F: Future,
mysql
only.Requires a Future
to complete before the specified duration
has
elapsed.
If the future
completes before the duration
has elapsed, then the
completed value is returned. Otherwise, an error is returned and
the future
is canceled.
sourcepub async fn spawn_blocking<F, R>(&self, f: F) -> Result<R, SpawnBlockingError>
Available on crate feature mysql
only.
pub async fn spawn_blocking<F, R>(&self, f: F) -> Result<R, SpawnBlockingError>
mysql
only.Runs the given closure on a thread where blocking is acceptable.
§Errors
See SpawnBlockingError
for details.
sourcepub fn spawn_blocking_background<F>(
&self,
f: F
) -> Result<(), SpawnBlockingError>
Available on crate feature mysql
only.
pub fn spawn_blocking_background<F>( &self, f: F ) -> Result<(), SpawnBlockingError>
mysql
only.Runs the given closure on a thread where blocking is acceptable.
It works similar to Runtime::spawn_blocking()
but doesn’t return a
Future
and is meant to be used for background tasks.
§Errors
See SpawnBlockingError
for details.
Trait Implementations§
source§impl PartialEq for Runtime
impl PartialEq for Runtime
impl Copy for Runtime
impl Eq for Runtime
impl StructuralPartialEq for Runtime
Auto Trait Implementations§
impl Freeze for Runtime
impl RefUnwindSafe for Runtime
impl Send for Runtime
impl Sync for Runtime
impl Unpin for Runtime
impl UnwindSafe for Runtime
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> IntoSql for T
impl<T> IntoSql for T
source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
Convert
self
to an expression for Diesel’s query builder. Read moresource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
Convert
&self
to an expression for Diesel’s query builder. Read more