Enum tauri::async_runtime::Runtime
source · [−]pub enum Runtime {
Tokio(TokioRuntime),
}
Expand description
A runtime used to execute asynchronous tasks.
Variants
Tokio(TokioRuntime)
The tokio runtime.
Implementations
sourceimpl Runtime
impl Runtime
sourcepub fn inner(&self) -> &TokioRuntime
pub fn inner(&self) -> &TokioRuntime
Gets a reference to the TokioRuntime
.
sourcepub fn handle(&self) -> RuntimeHandle
pub fn handle(&self) -> RuntimeHandle
Returns a handle of the async runtime.
sourcepub fn spawn<F: Future>(&self, task: F) -> JoinHandle<F::Output>ⓘNotable traits for JoinHandle<T>impl<T> Future for JoinHandle<T> type Output = Result<T>;
where
F: Future + Send + 'static,
F::Output: Send + 'static,
pub fn spawn<F: Future>(&self, task: F) -> JoinHandle<F::Output>ⓘNotable traits for JoinHandle<T>impl<T> Future for JoinHandle<T> type Output = Result<T>;
where
F: Future + Send + 'static,
F::Output: Send + 'static,
Spawns a future onto the runtime.
sourcepub fn spawn_blocking<F, R>(&self, func: F) -> JoinHandle<R>ⓘNotable traits for JoinHandle<T>impl<T> Future for JoinHandle<T> type Output = Result<T>;
where
F: FnOnce() -> R + Send + 'static,
R: Send + 'static,
pub fn spawn_blocking<F, R>(&self, func: F) -> JoinHandle<R>ⓘNotable traits for JoinHandle<T>impl<T> Future for JoinHandle<T> type Output = Result<T>;
where
F: FnOnce() -> R + Send + 'static,
R: Send + 'static,
Runs the provided function on an executor dedicated to blocking operations.
Auto Trait Implementations
impl !RefUnwindSafe for Runtime
impl Send for Runtime
impl Sync for Runtime
impl Unpin for Runtime
impl !UnwindSafe for Runtime
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more