Struct tauri::http::method::Method
x3A;:method::Method,
pub struct Method(_);
Expand description
The Request Method (VERB)
This type also contains constants for a number of common HTTP methods such as GET, POST, etc.
Currently includes 8 variants representing the 8 methods defined in RFC 7230, plus PATCH, and an Extension variant for all extensions.
#
Examplesuse http::Method;
assert_eq!(Method::GET, Method::from_bytes(b"GET").unwrap());
assert!(Method::GET.is_idempotent());
assert_eq!(Method::POST.as_str(), "POST");
#
ImplementationsMethod[src]#
implGET: Method[src]#
pub constGET
POST: Method[src]#
pub constPOST
PUT: Method[src]#
pub constPUT
DELETE: Method[src]#
pub constDELETE
HEAD: Method[src]#
pub constHEAD
OPTIONS: Method[src]#
pub constOPTIONS
CONNECT: Method[src]#
pub constCONNECT
PATCH: Method[src]#
pub constPATCH
TRACE: Method[src]#
pub constTRACE
from_bytes(src: &[u8]) -> Result<Method, InvalidMethod>[src]#
pub fnConverts a slice of bytes to an HTTP method.
is_safe(&self) -> bool[src]#
pub fnWhether a method is considered “safe”, meaning the request is essentially read-only.
See the spec for more words.
is_idempotent(&self) -> bool[src]#
pub fnWhether a method is considered “idempotent”, meaning the request has the same result if executed multiple times.
See the spec for more words.
as_str(&self) -> &str[src]#
pub fnReturn a &str representation of the HTTP method
#
Trait ImplementationsAsRef<str> for Method[src]#
implas_ref(&self) -> &str[src]#
pub fnPerforms the conversion.
Clone for Method[src]#
implclone(&self) -> Method[src]#
pub fnReturns a copy of the value. Read more
clone_from(&mut self, source: &Self)1.0.0[src]#
fnPerforms copy-assignment from source
. Read more
Debug for Method[src]#
implfmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]#
pub fnFormats the value using the given formatter. Read more
Default for Method[src]#
impldefault() -> Method[src]#
pub fnReturns the “default value” for a type. Read more
Display for Method[src]#
implfmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>[src]#
pub fnFormats the value using the given formatter. Read more
From<<'a Method> for Method[src]#
impl<'a>from(t: &'a Method) -> Method[src]#
pub fnPerforms the conversion.
FromStr for Method[src]#
implErr = InvalidMethod#
typeThe associated error which can be returned from parsing.
from_str(t: &str) -> Result<Method, <Method as FromStr>::Err>[src]#
pub fnParses a string s
to return a value of this type. Read more
Hash for Method[src]#
implhash<__H>(&self, state: &mut__H) where __H: Hasher,[src]#
pub fnFeeds this value into the given Hasher
. Read more
hash_slice<H>(data: &[Self], state: &mutH) where H: Hasher,1.3.0[src]#
fnFeeds a slice of this type into the given Hasher
. Read more
PartialEq<<'a Method> for Method[src]#
impl<'a>eq(&self, other: &&'a Method) -> bool[src]#
pub fnThis method tests for self
and other
values to be equal, and is used by ==
. Read more
ne(&self, other: &Rhs) -> bool1.0.0[src]#
#[must_use]fnThis method tests for !=
.
PartialEq<<'a str> for Method[src]#
impl<'a>eq(&self, other: &&'a str) -> bool[src]#
pub fnThis method tests for self
and other
values to be equal, and is used by ==
. Read more
ne(&self, other: &Rhs) -> bool1.0.0[src]#
#[must_use]fnThis method tests for !=
.
PartialEq<Method> for Method[src]#
impleq(&self, other: &Method) -> bool[src]#
pub fnThis method tests for self
and other
values to be equal, and is used by ==
. Read more
ne(&self, other: &Method) -> bool[src]#
pub fnThis method tests for !=
.
PartialEq<Method> for &'a Method[src]#
impl<'a>eq(&self, other: &Method) -> bool[src]#
pub fnThis method tests for self
and other
values to be equal, and is used by ==
. Read more
ne(&self, other: &Rhs) -> bool1.0.0[src]#
#[must_use]fnThis method tests for !=
.
PartialEq<str> for Method[src]#
impleq(&self, other: &str) -> bool[src]#
pub fnThis method tests for self
and other
values to be equal, and is used by ==
. Read more
ne(&self, other: &Rhs) -> bool1.0.0[src]#
#[must_use]fnThis method tests for !=
.
TryFrom<&'a [u8]> for Method[src]#
impl<'a>Error = InvalidMethod#
typeThe type returned in the event of a conversion error.
try_from( t: &'a [u8] ) -> Result<Method, <Method as TryFrom<&'a [u8]>>::Error>[src]#
pub fnPerforms the conversion.
TryFrom<<'a str> for Method[src]#
impl<'a>Error = InvalidMethod#
typeThe type returned in the event of a conversion error.
try_from( t: &'a str ) -> Result<Method, <Method as TryFrom<<'a str>>::Error>[src]#
pub fnPerforms the conversion.
Eq for Method#
implStructuralEq for Method#
implStructuralPartialEq for Method#
impl#
Auto Trait ImplementationsRefUnwindSafe for Method#
implSend for Method#
implSync for Method#
implUnpin for Method#
implUnwindSafe for Method#
impl#
Blanket ImplementationsAny for T where T: 'static + ?Sized,[src]#
impl<T>type_id(&self) -> TypeId[src]#
pub fnGets the TypeId
of self
. Read more
Borrow<T> for T where T: ?Sized,[src]#
impl<T>borrow(&self) -> &T[src]#
pub fnImmutably borrows from an owned value. Read more
BorrowMut<T> for T where T: ?Sized,[src]#
impl<T>borrow_mut(&mut self) -> &mutT[src]#
pub fnMutably borrows from an owned value. Read more
From<T> for T[src]#
impl<T>from(t: T) -> T[src]#
pub fnPerforms the conversion.
Into<U> for T where U: From<T>,[src]#
impl<T, U>into(self) -> U[src]#
pub fnPerforms the conversion.
ToOwned for T where T: Clone,[src]#
impl<T>Owned = T#
typeThe resulting type after obtaining ownership.
to_owned(&self) -> T[src]#
pub fnCreates owned data from borrowed data, usually by cloning. Read more
clone_into(&self, target: &mutT)[src]#
pub fn🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
ToString for T where T: Display + ?Sized,[src]#
impl<T>to_string(&self) -> String[src]#
pub default fnConverts the given value to a String
. Read more
TryFrom<U> for T where U: Into<T>,[src]#
impl<T, U>Error = Infallible#
typeThe type returned in the event of a conversion error.
try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]#
pub fnPerforms the conversion.
TryInto<U> for T where U: TryFrom<T>,[src]#
impl<T, U>Error = <U as TryFrom<T>>::Error#
typeThe type returned in the event of a conversion error.
try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]#
pub fnPerforms the conversion.