pub struct ChimesClient { /* private fields */ }Expand description
请求客户端
Implementations§
Source§impl ChimesClient
impl ChimesClient
pub fn new() -> Self
Sourcepub fn new_timeout(tm: u64) -> Self
pub fn new_timeout(tm: u64) -> Self
创建一个新的连接客户端
Sourcepub fn set_charset(self, charset: &str) -> Self
pub fn set_charset(self, charset: &str) -> Self
设置获取数据的编码方式
Sourcepub async fn post<T: Serialize>(self, url: &str, params: &T) -> Result<String>
pub async fn post<T: Serialize>(self, url: &str, params: &T) -> Result<String>
post方式提交数据 url: param:
Sourcepub async fn request_betyes<T: Serialize>(
self,
method_str: &str,
url: &str,
params: &T,
) -> Result<Vec<u8>>
pub async fn request_betyes<T: Serialize>( self, method_str: &str, url: &str, params: &T, ) -> Result<Vec<u8>>
请求
Sourcepub async fn request<T: Serialize>(
self,
method: Method,
url: &str,
params: &T,
) -> Result<String>
pub async fn request<T: Serialize>( self, method: Method, url: &str, params: &T, ) -> Result<String>
请求
Sourcepub async fn request_form_with_response(
self,
method: Method,
url: &str,
params: &String,
) -> Result<(String, HeaderMap)>
pub async fn request_form_with_response( self, method: Method, url: &str, params: &String, ) -> Result<(String, HeaderMap)>
请求
Sourcepub async fn request_with_response<T: Serialize>(
self,
method: Method,
url: &str,
params: &T,
) -> Result<(String, HeaderMap)>
pub async fn request_with_response<T: Serialize>( self, method: Method, url: &str, params: &T, ) -> Result<(String, HeaderMap)>
请求
pub fn insert_header(&mut self, key: &str, value: &str) -> &mut Self
pub fn put_header(&mut self, key: &str, value: &str)
Trait Implementations§
Source§impl Clone for ChimesClient
impl Clone for ChimesClient
Source§fn clone(&self) -> ChimesClient
fn clone(&self) -> ChimesClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ChimesClient
impl !RefUnwindSafe for ChimesClient
impl !Send for ChimesClient
impl !Sync for ChimesClient
impl Unpin for ChimesClient
impl !UnwindSafe for ChimesClient
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more