Trait AsContext

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

A marker trait promising that AsRef<Context<T>> is implemented in a way that can’t be invalidated

§Safety

Context must not be invalidated as references may exist for the lifetime of the runtime.

Required Associated Types§

Source

type Target: Sync + 'static

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T> AsContext for Context<T>
where T: Sync,