//! Rate limits for your own code, such as how many messages a user may send a minute or how many
//! times someone may guess a password.
//!
//! [`attempt`] counts an attempt for a key and returns whether it was within a [`Limit`]. When you
//! count only some attempts, such as failed logins, [`check`], [`hit`], and [`clear`] do the same
//! work in separate steps. Counts live in the default cache store. To limit requests to a route,
//! use the [`Throttle`](crate::http::middleware::Throttle) middleware. To learn more, check out the
//! [rate limiting guide](https://github.com/laravel/rust-framework/blob/0.x/docs/rate-limiting.md).
//!
//! ```no_run
//! use laravel::rate_limit::{self, Limit};
//!
//! # async fn send(user_id: u64) -> laravel::Result<()> {
//! let quota = rate_limit::attempt(&format!("messages:{user_id}"), Limit::per_minute(5)).await??;
//! # Ok(()) }
//! ```
//!
//! A limit allows its attempts all at once, then gives them back one at a time. For example, a
//! limit of 60 a minute allows a burst of 60, then one more each second. Over time, a key averages the limit,
//! but within one span it may use the burst and the attempts it gets back meanwhile, almost twice
//! the limit. A key that uses up `Limit::per_hour(1)` gets its next attempt exactly an hour later.
//! An attempt over the limit doesn't count, so retrying doesn't make the wait longer.
//!
//! A key may be any string, and it has one count. When its limit changes, such as when a team's
//! plan changes, the share of the limit the key has used carries over. A key that used half of 4
//! a minute has then used half of 2 a minute. To count one thing against two limits, use a key for each.
//!
//! Limits need a store that can [compare and swap](crate::cache::Store::compare_and_swap), as
//! the memory, database, and Redis stores can.
pub use ;