pub struct TokioRuntime { /* private fields */ }Expand description
Spawns onto one tokio runtime, captured as a handle at construction, and uses that runtime’s timers.
The default instance is TokioRuntime::current, taken while the cache is
built; DialCacheBuilder::build fails
with a configuration error outside a tokio context instead of panicking on
first use. The runtime must have its time driver enabled (tokio’s
enable_time or enable_all), or the first deadline panics inside the
detached work and surfaces as Error::Panic.
Implementations§
Source§impl TokioRuntime
impl TokioRuntime
Sourcepub fn current() -> Result<Self, ConfigError>
pub fn current() -> Result<Self, ConfigError>
The runtime of the current tokio context.
Sourcepub fn from_handle(handle: Handle) -> Self
pub fn from_handle(handle: Handle) -> Self
Use the runtime behind handle, whichever context later calls the cache.
Trait Implementations§
Source§impl Clone for TokioRuntime
impl Clone for TokioRuntime
Source§fn clone(&self) -> TokioRuntime
fn clone(&self) -> TokioRuntime
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TokioRuntime
impl Debug for TokioRuntime
Source§impl Runtime for TokioRuntime
Available on crate feature tokio only.
impl Runtime for TokioRuntime
Available on crate feature
tokio only.Auto Trait Implementations§
impl Freeze for TokioRuntime
impl RefUnwindSafe for TokioRuntime
impl Send for TokioRuntime
impl Sync for TokioRuntime
impl Unpin for TokioRuntime
impl UnsafeUnpin for TokioRuntime
impl UnwindSafe for TokioRuntime
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