#![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(not(feature = "std"), no_std)]
#![deny(warnings)]
#![allow(unknown_lints)]
#![allow(clippy::needless_doctest_main)]
extern crate alloc;
pub mod r#_guide;
pub mod clock;
mod errors;
mod gcra;
#[cfg(any(feature = "std", feature = "jitter"))]
mod jitter;
pub mod middleware;
pub mod nanos;
mod quota;
pub mod state;
pub use errors::*;
pub use gcra::NotUntil;
#[cfg(feature = "jitter")]
pub use jitter::Jitter;
#[cfg(all(feature = "std", not(feature = "jitter")))]
pub(crate) use jitter::Jitter;
pub use quota::Quota;
#[doc(inline)]
pub use state::RateLimiter;
#[cfg(feature = "std")]
pub use state::direct::RatelimitedSink;
#[cfg(feature = "std")]
pub use state::direct::RatelimitedStream;
pub mod prelude {
#[cfg(feature = "std")]
pub use crate::state::direct::SinkRateLimitExt;
#[cfg(feature = "std")]
pub use crate::state::direct::StreamRateLimitExt;
}
pub type DefaultDirectRateLimiter<
MW = middleware::NoOpMiddleware<<clock::DefaultClock as clock::Clock>::Instant>,
> = RateLimiter<state::direct::NotKeyed, state::InMemoryState, clock::DefaultClock, MW>;
pub type DefaultKeyedRateLimiter<
K,
MW = middleware::NoOpMiddleware<<clock::DefaultClock as clock::Clock>::Instant>,
S = state::keyed::DefaultHasher,
> = RateLimiter<K, state::keyed::DefaultKeyedStateStore<K, S>, clock::DefaultClock, MW>;