pub struct RouteGuardConfig { /* private fields */ }Expand description
Per-route override configuration. Inserted into request extensions
by the route_guard layer.
Implementations§
Source§impl RouteGuardConfig
impl RouteGuardConfig
Sourcepub fn max_body_size(self, size: u64) -> Self
pub fn max_body_size(self, size: u64) -> Self
Override the maximum body size for this route.
Sourcepub fn allowed_content_types<I, S>(self, types: I) -> Self
pub fn allowed_content_types<I, S>(self, types: I) -> Self
Override the allowed Content-Type list for this route.
Sourcepub fn skip_header(self, name: impl Into<String>) -> Self
pub fn skip_header(self, name: impl Into<String>) -> Self
Skip a globally-required header for this route.
Sourcepub fn require_header(self, name: impl Into<String>) -> Self
pub fn require_header(self, name: impl Into<String>) -> Self
Add an extra required header for this route.
Sourcepub fn merge_with(&self, global: &GuardConfig) -> GuardConfig
pub fn merge_with(&self, global: &GuardConfig) -> GuardConfig
Merge this route config with the global config. Route values override globals; unset values inherit from global.
Trait Implementations§
Source§impl Clone for RouteGuardConfig
impl Clone for RouteGuardConfig
Source§fn clone(&self) -> RouteGuardConfig
fn clone(&self) -> RouteGuardConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RouteGuardConfig
impl Debug for RouteGuardConfig
Source§impl Default for RouteGuardConfig
impl Default for RouteGuardConfig
Source§fn default() -> RouteGuardConfig
fn default() -> RouteGuardConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RouteGuardConfig
impl RefUnwindSafe for RouteGuardConfig
impl Send for RouteGuardConfig
impl Sync for RouteGuardConfig
impl Unpin for RouteGuardConfig
impl UnsafeUnpin for RouteGuardConfig
impl UnwindSafe for RouteGuardConfig
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