tokio_executor

Function enter

Source
pub fn enter() -> Result<Enter, EnterError>
Expand description

Marks the current thread as being within the dynamic extent of an executor.

Executor implementations should call this function before blocking the thread. If None is returned, the executor should fail by panicking or taking some other action without blocking the current thread. This prevents deadlocks due to multiple executors competing for the same thread.

ยงError

Returns an error if the current thread is already marked