pub enum Method {
GET,
POST,
PUT,
DELETE,
PATCH,
HEAD,
OPTIONS,
CONNECT,
TRACE,
UNKNOWN(String),
}Expand description
Defines the Method enum, representing HTTP request methods.
Variants§
GET
Represents the HTTP GET method.
POST
Represents the HTTP POST method.
PUT
Represents the HTTP PUT method.
DELETE
Represents the HTTP DELETE method.
PATCH
Represents the HTTP PATCH method.
HEAD
Represents the HTTP HEAD method.
OPTIONS
Represents the HTTP OPTIONS method.
CONNECT
Represents the HTTP CONNECT method.
TRACE
Represents the HTTP TRACE method.
UNKNOWN(String)
Unknown
Implementations§
Source§impl Method
impl Method
Sourcepub fn new() -> Method
pub fn new() -> Method
Creates a new instance of Method with the default value of Self::GET.
This is a shorthand for using the default method.
Sourcepub fn is_get(&self) -> bool
pub fn is_get(&self) -> bool
Checks if the current method is GET.
Returns true if the method is GET, otherwise returns false.
Sourcepub fn is_post(&self) -> bool
pub fn is_post(&self) -> bool
Checks if the current method is POST.
Returns true if the method is POST, otherwise returns false.
Sourcepub fn is_put(&self) -> bool
pub fn is_put(&self) -> bool
Checks if the current method is PUT.
Returns true if the method is PUT, otherwise returns false.
Sourcepub fn is_delete(&self) -> bool
pub fn is_delete(&self) -> bool
Checks if the current method is DELETE.
Returns true if the method is DELETE, otherwise returns false.
Sourcepub fn is_patch(&self) -> bool
pub fn is_patch(&self) -> bool
Checks if the current method is PATCH.
Returns true if the method is PATCH, otherwise returns false.
Sourcepub fn is_head(&self) -> bool
pub fn is_head(&self) -> bool
Checks if the current method is HEAD.
Returns true if the method is HEAD, otherwise returns false.
Sourcepub fn is_options(&self) -> bool
pub fn is_options(&self) -> bool
Checks if the current method is OPTIONS.
Returns true if the method is OPTIONS, otherwise returns false.
Sourcepub fn is_connect(&self) -> bool
pub fn is_connect(&self) -> bool
Checks if the current method is CONNECT.
Returns true if the method is CONNECT, otherwise returns false.
Sourcepub fn is_trace(&self) -> bool
pub fn is_trace(&self) -> bool
Checks if the current method is TRACE.
Returns true if the method is TRACE, otherwise returns false.
Sourcepub fn is_unknown(&self) -> bool
pub fn is_unknown(&self) -> bool
Checks if the current method is UNKNOWN.
Returns true if the method is UNKNOWN, otherwise returns false.