Struct aliyun_openapi_core_rust_sdk::client::rpc::RPClient
source · pub struct RPClient { /* private fields */ }Implementations§
source§impl RPClient
impl RPClient
sourcepub fn new(
access_key_id: impl Into<String>,
access_key_secret: impl Into<String>,
endpoint: impl Into<String>
) -> Self
pub fn new( access_key_id: impl Into<String>, access_key_secret: impl Into<String>, endpoint: impl Into<String> ) -> Self
Create a api client.
sourcepub fn request(
self,
method: impl Into<String>,
action: impl Into<String>
) -> Self
pub fn request( self, method: impl Into<String>, action: impl Into<String> ) -> Self
Create a request with the method and action.
Returns a Self for send request.
sourcepub fn get(self, action: impl Into<String>) -> Self
pub fn get(self, action: impl Into<String>) -> Self
Create a GET request with the action.
Returns a Self for send request.
sourcepub fn post(self, action: impl Into<String>) -> Self
pub fn post(self, action: impl Into<String>) -> Self
Create a POST request with the action.
Returns a Self for send request.
sourcepub fn query<I, T>(self, queries: I) -> Selfwhere
I: IntoIterator<Item = (T, T)>,
T: Into<String>,
pub fn query<I, T>(self, queries: I) -> Selfwhere I: IntoIterator<Item = (T, T)>, T: Into<String>,
Set queries for request.
Returns a Self for send request.
sourcepub fn version(self, version: impl Into<String>) -> Self
pub fn version(self, version: impl Into<String>) -> Self
Set version for request.
Returns a Self for send request.
sourcepub fn header(self, headers: impl Into<HashMap<String, String>>) -> Result<Self>
pub fn header(self, headers: impl Into<HashMap<String, String>>) -> Result<Self>
Set header for request.
Returns a Self for send request.
sourcepub fn timeout(self, timeout: Duration) -> Self
pub fn timeout(self, timeout: Duration) -> Self
Set a timeout for connect, read and write operations of a Client.
Default is no timeout.
sourcepub async fn json<T: DeserializeOwned>(self) -> Result<T>
pub async fn json<T: DeserializeOwned>(self) -> Result<T>
Send a request to service. Try to deserialize the response body as JSON.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for RPClient
impl Send for RPClient
impl Sync for RPClient
impl Unpin for RPClient
impl UnwindSafe for RPClient
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