pub trait DataContext<'a> {
// Required methods
fn data<D: Any + Send + Sync>(&self) -> Result<&'a D>;
fn data_unchecked<D: Any + Send + Sync>(&self) -> &'a D;
fn data_opt<D: Any + Send + Sync>(&self) -> Option<&'a D>;
}
Expand description
Data related functions of the context.
Required Methods§
Sourcefn data<D: Any + Send + Sync>(&self) -> Result<&'a D>
fn data<D: Any + Send + Sync>(&self) -> Result<&'a D>
Gets the global data defined in the Context
or Schema
.
If both Schema
and Query
have the same data type, the data in the
Query
is obtained.
§Errors
Returns a Error
if the specified type data does not exist.
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.