1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//! # Predicates
//!
//! [`carapax::Predicate`] is a decorator that helps determine whether a handler should run or not.
//! This is particularly useful for implementing functionalities like rate-limiting
//! or restricting certain users from triggering a handler.
//!
//! A predicate handler must implement the [`carapax::Handler`] trait,
//! and return a [`carapax::PredicateResult`]
//! or a type that can be converted into it:
//!
//! | From | To |
//! |---------------------|----------------------------------------|
//! | `true` | [`carapax::PredicateResult::True`] |
//! | `false` | [`carapax::PredicateResult::False`] |
//! | `Result<T, E>::Ok` | `PredicateResult::from::<T>()` |
//! | `Result<T, E>::Err` | [`carapax::PredicateResult::Err`] |
use ;
use crateAppError;
async
async