pub enum OwnedMethods {
One(Method),
Set(Cow<'static, [Method]>),
Any,
}Expand description
An owned counterpart to Methods, stored by routes like
RouteFn.
Rarely constructed directly: RouteFn::new accepts
anything convertible into it, like a Method, a &'static [Method], a
Vec<Method>, or a Methods value (so Methods::Any expresses an
any-method route). The common single-method case is stored without
allocating.
Variants§
One(Method)
Responds to a single method.
Set(Cow<'static, [Method]>)
Responds to each method in the set.
Any
Responds to every HTTP method.
Implementations§
Source§impl OwnedMethods
impl OwnedMethods
Sourcepub fn as_methods(&self) -> Methods<'_>
pub fn as_methods(&self) -> Methods<'_>
Borrows this set as a Methods value, as returned by
Route::methods.
Trait Implementations§
Source§impl Clone for OwnedMethods
impl Clone for OwnedMethods
Source§impl Debug for OwnedMethods
impl Debug for OwnedMethods
impl Eq for OwnedMethods
Source§impl From<&'static [Method]> for OwnedMethods
impl From<&'static [Method]> for OwnedMethods
Source§impl From<Method> for OwnedMethods
impl From<Method> for OwnedMethods
Source§impl From<Methods<'static>> for OwnedMethods
impl From<Methods<'static>> for OwnedMethods
Source§impl PartialEq for OwnedMethods
impl PartialEq for OwnedMethods
impl StructuralPartialEq for OwnedMethods
Auto Trait Implementations§
impl Freeze for OwnedMethods
impl RefUnwindSafe for OwnedMethods
impl Send for OwnedMethods
impl Sync for OwnedMethods
impl Unpin for OwnedMethods
impl UnsafeUnpin for OwnedMethods
impl UnwindSafe for OwnedMethods
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
impl<T> CloneAny for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.