pub struct Runtime { /* private fields */ }Expand description
Runtime holds the runtime reference and non-clonable handles to prevent handle usage after runtime shutdown.
Implementations§
source§impl Runtime
impl Runtime
sourcepub fn new(
read_runtime: Option<Arc<BackgroundShutdownRuntime>>,
write_runtime: Option<Arc<BackgroundShutdownRuntime>>,
user_runtime_handle: Handle,
) -> Runtime
pub fn new( read_runtime: Option<Arc<BackgroundShutdownRuntime>>, write_runtime: Option<Arc<BackgroundShutdownRuntime>>, user_runtime_handle: Handle, ) -> Runtime
Create a new runtime with runtimes if given.
sourcepub fn read(&self) -> &SingletonHandle
pub fn read(&self) -> &SingletonHandle
Get the non-clonable read runtime handle.
sourcepub fn write(&self) -> &SingletonHandle
pub fn write(&self) -> &SingletonHandle
Get the non-clonable write runtime handle.
sourcepub fn user(&self) -> &SingletonHandle
pub fn user(&self) -> &SingletonHandle
Get the non-clonable user runtime handle.
Trait Implementations§
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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