pub trait AsyncAccessPredicate: Send + Sync {
// Required methods
fn eval<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 AccessContext,
) -> Pin<Box<dyn Future<Output = Result<(), AccessError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn name(&self) -> &'static str;
}Required Methods§
Sourcefn eval<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 AccessContext,
) -> Pin<Box<dyn Future<Output = Result<(), AccessError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn eval<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 AccessContext,
) -> Pin<Box<dyn Future<Output = Result<(), AccessError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Custom predicate contract:
- May be async and perform I/O.
- May depend on application state.
- Must be side-effect free, idempotent, and must not panic.