pub enum Method {
Options,
Get,
Post,
Put,
Delete,
Head,
Trace,
Connect,
Patch,
Extension(String),
}
Expand description
The Request Method (VERB)
Currently includes 8 variants representing the 8 methods defined in RFC 7230, plus PATCH, and an Extension variant for all extensions.
It may make sense to grow this to include all variants currently registered with IANA, if they are at all common to use.
Variants§
Options
OPTIONS
Get
GET
Post
POST
Put
PUT
Delete
DELETE
Head
HEAD
Trace
TRACE
Connect
CONNECT
Patch
PATCH
Extension(String)
Method extensions. An example would be let m = Extension("FOO".to_string())
.
Implementations§
source§impl Method
impl Method
sourcepub fn safe(&self) -> bool
pub fn safe(&self) -> bool
Whether a method is considered “safe”, meaning the request is essentially read-only.
See the spec for more words.
sourcepub fn idempotent(&self) -> bool
pub fn idempotent(&self) -> bool
Whether a method is considered “idempotent”, meaning the request has the same result is executed multiple times.
See the spec for more words.
Trait Implementations§
impl Eq for Method
impl StructuralPartialEq for Method
Auto Trait Implementations§
impl Freeze for Method
impl RefUnwindSafe for Method
impl Send for Method
impl Sync for Method
impl Unpin for Method
impl UnwindSafe for Method
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
)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.