Enum front_line::Method

source ·
pub enum Method {
    Get,
    Post,
    Put,
    Delete,
    Head,
    Options,
    Connect,
    Trace,
    Patch,
}
Expand description

Represents HTTP methods.

These methods are tokens that indicate the desired action to be performed on the identified resource.

Variants§

§

Get

Represents the HTTP GET method.

Used to retrieve data from a server.

§

Post

Represents the HTTP POST method.

Used to submit data to a server for processing.

§

Put

Represents the HTTP PUT method.

Used to update a resource or create a new resource if it does not exist.

§

Delete

Represents the HTTP DELETE method.

Used to delete a resource.

§

Head

Represents the HTTP HEAD method.

Used to retrieve metadata about a resource.

§

Options

Represents the HTTP OPTIONS method.

Used to describe the communication options for the target resource.

§

Connect

Represents the HTTP CONNECT method.

Used to establish a network connection for a given URI.

§

Trace

Represents the HTTP TRACE method.

Used for diagnostic purposes.

§

Patch

Represents the HTTP PATCH method.

Used to apply partial modifications to a resource.

Implementations§

source§

impl Method

source

pub fn parse(request_line: &[u8]) -> Option<(Method, &[u8])>

Parse an HTTP request line to determine the method.

This function will attempt to parse the provided request line slice and return the identified HTTP method and the remaining part of the request line.

Arguments
  • request_line - A byte slice containing the request line to parse.
Returns

Returns Some((Method, &[u8])) if a valid HTTP method is found. Otherwise, returns None.

Trait Implementations§

source§

impl Clone for Method

source§

fn clone(&self) -> Method

Returns a copy 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 PartialEq for Method

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for Method

source§

impl Eq for Method

source§

impl StructuralEq 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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

§

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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.