async_graphql

Trait Guard

Source
pub trait Guard {
    // Required method
    fn check(
        &self,
        ctx: &Context<'_>,
    ) -> impl Future<Output = Result<()>> + Send;
}
Expand description

Field guard

Guard is a pre-condition for a field that is resolved if Ok(()) is returned, otherwise an error is returned.

Required Methods§

Source

fn check(&self, ctx: &Context<'_>) -> impl Future<Output = Result<()>> + Send

Check whether the guard will allow access to the field.

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> Guard for T
where T: Fn(&Context<'_>) -> Result<()> + Send + Sync + 'static,