Trait async_graphql::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.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T> Guard for T
where T: Fn(&Context<'_>) -> Result<()> + Send + Sync + 'static,