pub struct SmolExec(/* private fields */);Expand description
The SmolRT implements AsyncRuntime trait
Trait Implementations§
Source§impl AsyncExec for SmolExec
impl AsyncExec for SmolExec
Source§fn spawn<F, R>(&self, f: F) -> Self::AsyncJoiner<R>
fn spawn<F, R>(&self, f: F) -> Self::AsyncJoiner<R>
Spawn a task in the background
Source§fn spawn_detach<F, R>(&self, f: F)
fn spawn_detach<F, R>(&self, f: F)
Depends on how you initialize SmolRT, spawn with executor or globally
Source§fn block_on<F, R>(&self, f: F) -> R
fn block_on<F, R>(&self, f: F) -> R
Run a future to completion on the runtime
NOTE: when initialized with an executor, will block current thread until the future returns
type AsyncJoiner<R: Send> = SmolJoinHandle<R>
type ThreadJoiner<R: Send> = BlockingJoinHandle<R>
Source§fn spawn_blocking<F, R>(&self, f: F) -> Self::ThreadJoiner<R>
fn spawn_blocking<F, R>(&self, f: F) -> Self::ThreadJoiner<R>
Run blocking code in a background thread pool, and return an async join handle Read more
Auto Trait Implementations§
impl Freeze for SmolExec
impl !RefUnwindSafe for SmolExec
impl Send for SmolExec
impl Sync for SmolExec
impl Unpin for SmolExec
impl UnsafeUnpin for SmolExec
impl !UnwindSafe for SmolExec
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