FromContext

Trait FromContext 

Source
pub trait FromContext {
    // Required method
    fn from_context(ctx: &Context) -> Self;
}
Expand description

A trait to go from a Context to a type T.

Implementing this for a type allows it to be directly injected into tool handlers as a parameter.

Required Methods§

Source

fn from_context(ctx: &Context) -> Self

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: 'static> FromContext for Inject<T>

Implement ability to get a Inject<T> from the server’s context