pub trait FromContext<T> {
// Required method
fn from(value: &T) -> &Self;
}
Expand description
Conversion trait for context types
Used to support different context types for different parts of an
application. By making each GraphQL
type only aware of as much
context as it needs to, isolation and robustness can be
improved. Implement this trait if you have contexts that can
generally be converted between each other.
The empty tuple ()
can be converted into from any context type,
making it suitable for GraphQL
that don’t need any context to
work, e.g. scalars or enums.
Required Methods§
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.