pub unsafe trait AsContext: AsRef<Context<Self::Target>> {
    type Target: Sync;
}
Expand description

A marker trait promising that AsRef<Context<T>> is implemented in a way that can’t be invalidated and that Self doesn’t impl std::ops::Drop

Safety

Types that implement AsContext cannot impl std::ops::Drop because doing so will result in destructor functions being registered by the thread_local macro that will deallocate memory regardless of whether shutdown-barrier::guard_thread_shutdown is used to synchronize thread destruction.

Required Associated Types§

Implementors§