pub struct OwnedRuntime(/* private fields */);Expand description
A tokio runtime owned by a node, shut down without blocking.
Dropping a tokio::runtime::Runtime panics when it happens inside an
asynchronous context, because the drop blocks until the worker threads
join. A node built outside a runtime and dropped inside one is an ordinary
thing for a test or a spawn_blocking body to do, so this wrapper calls
shutdown_background
instead: the workers are detached and reaped by the process rather than
joined by the dropping thread.
Trait Implementations§
Source§impl Debug for OwnedRuntime
impl Debug for OwnedRuntime
Source§impl Drop for OwnedRuntime
impl Drop for OwnedRuntime
Auto Trait Implementations§
impl !Freeze for OwnedRuntime
impl RefUnwindSafe for OwnedRuntime
impl Send for OwnedRuntime
impl Sync for OwnedRuntime
impl Unpin for OwnedRuntime
impl UnsafeUnpin for OwnedRuntime
impl UnwindSafe for OwnedRuntime
Blanket Implementations§
impl<T> Allocation for T
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