Struct pavex::router::MethodAllowList
source · pub struct MethodAllowList { /* private fields */ }
Expand description
The variant of AllowedMethods
that only allows a finite set of HTTP methods for a given path.
Check out AllowedMethods
for more information.
Implementations§
source§impl MethodAllowList
impl MethodAllowList
sourcepub fn from_iter(iter: impl IntoIterator<Item = Method>) -> Self
pub fn from_iter(iter: impl IntoIterator<Item = Method>) -> Self
Create a new instance of MethodAllowList
from an iterator
that yields Method
s.
sourcepub fn iter(&self) -> impl Iterator<Item = &Method>
pub fn iter(&self) -> impl Iterator<Item = &Method>
Iterate over the allowed methods, returned as a reference.
sourcepub fn into_iter(self) -> impl Iterator<Item = Method>
pub fn into_iter(self) -> impl Iterator<Item = Method>
Consume self
and return an iterator over the allowed methods.
sourcepub fn allow_header_value(&self) -> Option<HeaderValue>
pub fn allow_header_value(&self) -> Option<HeaderValue>
The value that should be set for the Allow
header
in a 405 Method Not Allowed
response for this route path.
It returns None
if there are no allowed methods.
It returns the comma-separated list of allowed methods otherwise.
Trait Implementations§
source§impl Clone for MethodAllowList
impl Clone for MethodAllowList
source§fn clone(&self) -> MethodAllowList
fn clone(&self) -> MethodAllowList
Returns a copy 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 MethodAllowList
impl Debug for MethodAllowList
source§impl From<MethodAllowList> for AllowedMethods
impl From<MethodAllowList> for AllowedMethods
source§fn from(methods: MethodAllowList) -> Self
fn from(methods: MethodAllowList) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for MethodAllowList
impl RefUnwindSafe for MethodAllowList
impl Send for MethodAllowList
impl Sync for MethodAllowList
impl Unpin for MethodAllowList
impl UnwindSafe for MethodAllowList
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)