Struct async_graphql::extensions::ExtensionContext
source · [−]pub struct ExtensionContext<'a> { /* private fields */ }
Expand description
Context for extension
Implementations
sourceimpl<'a> ExtensionContext<'a>
impl<'a> ExtensionContext<'a>
sourcepub fn stringify_execute_doc(
&self,
doc: &ExecutableDocument,
variables: &Variables
) -> String
pub fn stringify_execute_doc(
&self,
doc: &ExecutableDocument,
variables: &Variables
) -> String
Convert the specified ExecutableDocument into a query string.
Usually used for log extension, it can hide secret arguments.
sourcepub fn data<D: Any + Send + Sync>(&self) -> Result<&'a D>
pub 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.
Trait Implementations
Auto Trait Implementations
impl<'a> !RefUnwindSafe for ExtensionContext<'a>
impl<'a> Send for ExtensionContext<'a>
impl<'a> Sync for ExtensionContext<'a>
impl<'a> Unpin for ExtensionContext<'a>
impl<'a> !UnwindSafe for ExtensionContext<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more