Skip to main content

Method

Enum Method 

Source
#[non_exhaustive]
pub enum Method { Delete, Get, Head, Patch, Post, Put, }
Available on crate feature export-azure only.
Expand description

Variants (Non-exhaustive)ยง

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
ยง

Delete

The DELETE method requests that the origin server remove the association between the target resource and its current functionality.

See RFC7231, Section 4.3.5.

ยง

Get

The GET method requests transfer of a current selected representation for the target resource.

See RFC7231, Section 4.3.1.

ยง

Head

The HEAD method is identical to GET except that the server MUST NOT send a message body in the response.

See RFC7231, Section 4.3.2.

ยง

Patch

The PATCH method requests that a set of changes described in the request entity be applied to the resource identified by the Request- URI.

See RFC5789, Section 2.

ยง

Post

The POST method requests that the target resource process the representation enclosed in the request according to the resourceโ€™s own specific semantics.

For example, POST is used for the following functions (among others):

  • Providing a block of data, such as the fields entered into an HTML form, to a data-handling process;
  • Posting a message to a bulletin board, newsgroup, mailing list, blog, or similar group of articles;
  • Creating a new resource that has yet to be identified by the origin server; and
  • Appending data to a resourceโ€™s existing representation(s).

See RFC7231, Section 4.3.3.

ยง

Put

The PUT method requests that the state of the target resource be created or replaced with the state defined by the representation enclosed in the request message payload.

See RFC7231, Section 4.3.4.

Implementationsยง

Sourceยง

impl Method

Source

pub fn is_safe(&self) -> bool

Whether a method is considered โ€œsafeโ€, meaning the request is essentially read-only.

See the spec for more details.

Source

pub const fn as_str(&self) -> &'static str

Returns the HTTP method as a static string slice.

Trait Implementationsยง

Sourceยง

impl AsRef<str> for Method

Sourceยง

fn as_ref(&self) -> &'static str

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl Clone for Method

Sourceยง

fn clone(&self) -> Method

Returns a duplicate of the value. Read more
1.0.0 ยท Sourceยง

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Sourceยง

impl Debug for Method

Sourceยง

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Sourceยง

impl<'de> Deserialize<'de> for Method

Sourceยง

fn deserialize<D>( deserializer: D, ) -> Result<Method, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Sourceยง

impl Display for Method

Sourceยง

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Sourceยง

impl FromStr for Method

Sourceยง

type Err = Error

The associated error which can be returned from parsing.
Sourceยง

fn from_str(s: &str) -> Result<Method, <Method as FromStr>::Err>

Parses a string s to return a value of this type. Read more
Sourceยง

impl Hash for Method

Sourceยง

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 ยท Sourceยง

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Sourceยง

impl PartialEq for Method

Sourceยง

fn eq(&self, other: &Method) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 ยท Sourceยง

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Sourceยง

impl Serialize for Method

Sourceยง

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Sourceยง

impl<'a> TryFrom<&'a str> for Method

Sourceยง

type Error = Error

The type returned in the event of a conversion error.
Sourceยง

fn try_from( value: &'a str, ) -> Result<Method, <Method as TryFrom<&'a str>>::Error>

Performs the conversion.
Sourceยง

impl Copy for Method

Sourceยง

impl Eq for Method

Sourceยง

impl StructuralPartialEq for Method

Auto Trait Implementationsยง

Blanket Implementationsยง

Sourceยง

impl<T> Any for T
where T: 'static + ?Sized,

Sourceยง

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Sourceยง

impl<T> Borrow<T> for T
where T: ?Sized,

Sourceยง

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Sourceยง

impl<T> BorrowMut<T> for T
where T: ?Sized,

Sourceยง

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Sourceยง

impl<T> CloneToUninit for T
where T: Clone,

Sourceยง

unsafe fn clone_to_uninit(&self, dest: *mut u8)

๐Ÿ”ฌThis is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Sourceยง

impl<D> DeserializeWith<JsonFormat> for D

Sourceยง

fn deserialize_with(body: ResponseBody) -> Result<D, Error>

Deserialize the response body using the specified format. Read more
Sourceยง

impl<T> DynClone for T
where T: Clone,

Sourceยง

fn __clone_box(&self, _: Private) -> *mut ()

Sourceยง

impl<T> From<T> for T

Sourceยง

fn from(t: T) -> T

Returns the argument unchanged.

Sourceยง

impl<T> Instrument for T

Sourceยง

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Sourceยง

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Sourceยง

impl<T, U> Into<U> for T
where U: From<T>,

Sourceยง

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Sourceยง

impl<T> PolicyExt for T
where T: ?Sized,

Sourceยง

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Sourceยง

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Sourceยง

impl<T> Same for T

Sourceยง

type Output = T

Should always be Self
Sourceยง

impl<T> ToOwned for T
where T: Clone,

Sourceยง

type Owned = T

The resulting type after obtaining ownership.
Sourceยง

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Sourceยง

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Sourceยง

impl<T> ToString for T
where T: Display + ?Sized,

Sourceยง

fn to_string(&self) -> String

Converts the given value to a String. Read more
Sourceยง

impl<T> ToStringFallible for T
where T: Display,

Sourceยง

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Sourceยง

type Error = Infallible

The type returned in the event of a conversion error.
Sourceยง

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Sourceยง

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Sourceยง

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Sourceยง

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Sourceยง

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Sourceยง

fn vzip(self) -> V

Sourceยง

impl<T> WithSubscriber for T

Sourceยง

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Sourceยง

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Sourceยง

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,