pub struct LevelRuntime { /* private fields */ }Expand description
A wrapper for a collection of tokio current-thread runtimes.
It offers a load leveling heuristic, but not work stealing.
Implementations§
Source§impl LevelRuntime
impl LevelRuntime
Sourcepub fn set_default(&self)
pub fn set_default(&self)
Register this LevelRuntime as the default runtime for the static
level_runtime::spawn* family functions.
Sourcepub fn handle(&self) -> LevelRuntimeHandle
pub fn handle(&self) -> LevelRuntimeHandle
Get a spawn handle for the runtime.
Sourcepub fn run_with_termination(
self,
termination: impl Future<Output = ()> + Send + 'static,
)
pub fn run_with_termination( self, termination: impl Future<Output = ()> + Send + 'static, )
Execute this runtime. When termination completes, the backing executors will close.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LevelRuntime
impl !RefUnwindSafe for LevelRuntime
impl Send for LevelRuntime
impl Sync for LevelRuntime
impl Unpin for LevelRuntime
impl UnsafeUnpin for LevelRuntime
impl !UnwindSafe for LevelRuntime
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