pub struct Route {
pub host: Option<String>,
pub method: Option<Method>,
pub path_prefix: String,
pub limits: Vec<RateLimit>,
pub on_limit: ThrottleBehavior,
}Expand description
A route definition that matches requests and applies rate limits.
Fields§
§host: Option<String>Optional host to match (e.g., “api.example.com”).
method: Option<Method>Optional HTTP method to match.
path_prefix: StringPath prefix to match (e.g., “/order”). Empty matches all paths.
limits: Vec<RateLimit>Rate limits to apply (all must pass).
on_limit: ThrottleBehaviorBehavior when rate limit is exceeded.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Route
impl RefUnwindSafe for Route
impl Send for Route
impl Sync for Route
impl Unpin for Route
impl UnwindSafe for Route
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more