Trait async_local::AsContext
source · Expand description
A marker trait promising AsRef<Context<T>
> is implemented in a way that can’t be invalidated
Safety
When assigned to a thread local, the pin drop guarantee must be upheld for Context<T>
: it cannot be wrapped in a pointer type nor cell type and it must not be invalidated nor repurposed until when drop happens as a consequence of the thread dropping.