pub enum Method {
Get,
Head,
Post,
Put,
Patch,
Delete,
}
Expand description
Supported HTTP Methods.
Variants§
Get
GET Method.
Head
HEAD Method.
Post
POST Method.
Put
PUT Method.
Patch
PATCH Method.
Delete
Delete Method.
Implementations§
Source§impl Method
impl Method
Sourcepub fn try_from(bytes: &[u8]) -> Result<Self, RequestError>
pub fn try_from(bytes: &[u8]) -> Result<Self, RequestError>
Returns a Method
object if the parsing of bytes
is successful.
The method is case sensitive. A call to try_from with the input b“get“ will return an error, but when using the input b“GET“, it returns Method::Get.
§Errors
InvalidHttpMethod
is returned if the specified HTTP method is unsupported.
Trait Implementations§
impl Copy for Method
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