[][src]Trait async_graphql::guard::Guard

pub trait Guard {
#[must_use]    pub fn check<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        ctx: &'life1 Context<'life2>
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
; }

Field guard

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

This trait is defined through the async-trait macro.

Required methods

#[must_use]pub fn check<'life0, 'life1, 'life2, 'async_trait>(
    &'life0 self,
    ctx: &'life1 Context<'life2>
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    Self: 'async_trait, 
[src]

Check whether the guard will allow access to the field.

Loading content...

Implementors

impl<A: Guard + Send + Sync, B: Guard + Send + Sync> Guard for And<A, B>[src]

impl<A: Guard + Send + Sync, B: Guard + Send + Sync> Guard for Or<A, B>[src]

Loading content...