pub struct RequestParts<'r> { /* private fields */ }
Expand description

HTTP 请求信息

不包含请求体信息

Implementations§

source§

impl<'r> RequestParts<'r>

source

pub fn builder() -> RequestPartsBuilder<'r>

创建 HTTP 请求信息构建器

source

pub fn url(&self) -> &Uri

获取 HTTP 请求 URL

source

pub fn url_mut(&mut self) -> &mut Uri

获取 HTTP 请求 URL 的可变引用

source

pub fn version(&self) -> Version

获取请求 HTTP 版本

source

pub fn version_mut(&mut self) -> &mut Version

获取请求 HTTP 版本的可变引用

source

pub fn method(&self) -> &Method

获取请求 HTTP 方法

source

pub fn method_mut(&mut self) -> &mut Method

获取请求 HTTP 方法的可变引用

source

pub fn headers(&self) -> &HeaderMap

获取请求 HTTP Headers

source

pub fn headers_mut(&mut self) -> &mut HeaderMap

获取请求 HTTP Headers 的可变引用

source

pub fn extensions(&self) -> &Extensions

获取扩展信息

source

pub fn extensions_mut(&mut self) -> &mut Extensions

获取扩展信息的可变引用

source

pub fn user_agent(&self) -> UserAgent

获取 UserAgent

source

pub fn appended_user_agent(&self) -> &UserAgent

获取追加的 UserAgent

source

pub fn appended_user_agent_mut(&mut self) -> &mut UserAgent

获取追加的 UserAgent 的可变引用

source

pub fn resolved_ip_addrs(&self) -> Option<&[IpAddr]>

获取预解析的服务器套接字地址

source

pub fn resolved_ip_addrs_mut(&mut self) -> &mut Option<Cow<'r, [IpAddr]>>

获取预解析的服务器套接字地址的可变引用

source

pub fn on_uploading_progress( &'r self ) -> Option<&'r (dyn Fn(TransferProgressInfo<'_>) -> Result<()> + Send + Sync + 'r)>

获取上传进度回调

source

pub fn on_uploading_progress_mut( &mut self ) -> &mut Option<OnProgressCallback<'r>>

获取上传进度回调的可变引用

source

pub fn on_receive_response_status( &'r self ) -> Option<&'r (dyn Fn(StatusCode) -> Result<()> + Send + Sync + 'r)>

获取接受到响应状态回调

source

pub fn on_receive_response_status_mut( &mut self ) -> &mut Option<OnStatusCodeCallback<'r>>

获取接受到响应状态回调的可变引用

source

pub fn on_receive_response_header( &'r self ) -> Option<&'r (dyn Fn(&HeaderName, &HeaderValue) -> Result<()> + Send + Sync + 'r)>

获取接受到响应 Header 回调

source

pub fn on_receive_response_header_mut( &mut self ) -> &mut Option<OnHeaderCallback<'r>>

获取接受到响应 Header 回调的可变引用

Trait Implementations§

source§

impl Debug for RequestParts<'_>

source§

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

Formats the value using the given formatter. Read more
source§

impl Default for RequestParts<'_>

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'r> !RefUnwindSafe for RequestParts<'r>

§

impl<'r> Send for RequestParts<'r>

§

impl<'r> Sync for RequestParts<'r>

§

impl<'r> Unpin for RequestParts<'r>

§

impl<'r> !UnwindSafe for RequestParts<'r>

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