pub enum Method {
Get,
Post,
Put,
Delete,
Patch,
Head,
Options,
Connect,
Trace,
Unknown(String),
}Expand description
Defines the Method enum, representing HTTP request methods.
This enum provides a comprehensive list of standard HTTP methods,
such as GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS, CONNECT, and TRACE.
It also includes an UNKNOWN variant for unrecognized 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 is_options(&self) -> bool
pub fn is_options(&self) -> bool
Sourcepub fn is_connect(&self) -> bool
pub fn is_connect(&self) -> bool
Sourcepub fn is_unknown(&self) -> bool
pub fn is_unknown(&self) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Method
impl<'de> Deserialize<'de> for Method
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Method, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Method, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Display for Method
Implements the Display trait for Method, allowing it to be formatted as a string.
impl Display for Method
Implements the Display trait for Method, allowing it to be formatted as a string.
impl Eq for Method
Source§impl FromStr for Method
Implements the FromStr trait for Method, allowing conversion from a string slice.
impl FromStr for Method
Implements the FromStr trait for Method, allowing conversion from a string slice.
Source§fn from_str(methods_str: &str) -> Result<Method, <Method as FromStr>::Err>
fn from_str(methods_str: &str) -> Result<Method, <Method as FromStr>::Err>
Converts a string slice into a Method variant.
This method attempts to parse the input string into a known Method variant.
If the string does not match any known method, it returns an UNKNOWN variant
containing the original string.
§Arguments
&str- The string slice to convert.
§Returns
A Result containing the Method variant if successful, or Self::Err on failure.
Source§impl Serialize for Method
impl Serialize for Method
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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 UnsafeUnpin for Method
impl UnwindSafe for Method
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendClone for T
impl<T> AnySendSync for T
impl<T> AnySendSyncClone for T
impl<T> AnySync for T
impl<T> AnySyncClone for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
key and return true if they are equal.