Skip to main content

handle

Function handle 

Source
pub fn handle() -> Result<Handle, Error>
Available on crate feature tokio only.
Expand description

The current runtime when called inside one, else the fallback runtime, which runs for the rest of the process. A host with no tokio runtime of its own hands this to tokio-based libraries instead of starting another. A supplied current runtime must have I/O and timers enabled and stay driven until its operations finish.

ยงErrors

When there is no current runtime and the fallback could not start.