pub struct LevelRuntimeHandle { /* private fields */ }Expand description
A handle to a LevelRuntime for spawning tasks.
Implementations§
Source§impl LevelRuntimeHandle
impl LevelRuntimeHandle
Sourcepub fn spawn_balanced<F>(&self, future: F) -> JoinHandle<F::Output>
pub fn spawn_balanced<F>(&self, future: F) -> JoinHandle<F::Output>
Spawn this future on one of the workers; choose which one based on a load heuristic.
Sourcepub fn pick_worker(&self) -> &LevelWorkerHandle
pub fn pick_worker(&self) -> &LevelWorkerHandle
Get one consistent worker handle
Sourcepub fn spawn_on_each<F>(
&self,
future: impl Fn() -> F,
) -> Vec<JoinHandle<F::Output>>
pub fn spawn_on_each<F>( &self, future: impl Fn() -> F, ) -> Vec<JoinHandle<F::Output>>
Spawn a copy of this future on each runtime. Do this for server listeners using SO_REUSEADDR.
Trait Implementations§
Source§impl Clone for LevelRuntimeHandle
impl Clone for LevelRuntimeHandle
Source§fn clone(&self) -> LevelRuntimeHandle
fn clone(&self) -> LevelRuntimeHandle
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for LevelRuntimeHandle
impl RefUnwindSafe for LevelRuntimeHandle
impl Send for LevelRuntimeHandle
impl Sync for LevelRuntimeHandle
impl Unpin for LevelRuntimeHandle
impl UnsafeUnpin for LevelRuntimeHandle
impl UnwindSafe for LevelRuntimeHandle
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