pub struct AsyncInterface { /* private fields */ }Expand description
One interface of the Web API.
Implementations§
Source§impl AsyncInterface
impl AsyncInterface
Sourcepub fn new(
http_client: Client,
base_address: Url,
iface: impl Into<String>,
api_key: impl Into<String>,
) -> Self
pub fn new( http_client: Client, base_address: Url, iface: impl Into<String>, api_key: impl Into<String>, ) -> Self
Creates an interface for the given Web API interface.
Sourcepub fn base_address(&self) -> &Url
pub fn base_address(&self) -> &Url
The base address of the Web API.
Sourcepub fn set_timeout(&self, timeout: Duration)
pub fn set_timeout(&self, timeout: Duration)
Sets the timeout for Web API requests.
Sourcepub async fn call(
&self,
func: &str,
version: i32,
args: &[WebApiArgument],
) -> Result<KeyValue, SteamError>
pub async fn call( &self, func: &str, version: i32, args: &[WebApiArgument], ) -> Result<KeyValue, SteamError>
Calls a Web API function. The response is requested as VDF and parsed
into a KeyValue.
Sourcepub async fn call_with_method(
&self,
method: Method,
func: &str,
version: i32,
args: &[WebApiArgument],
) -> Result<KeyValue, SteamError>
pub async fn call_with_method( &self, method: Method, func: &str, version: i32, args: &[WebApiArgument], ) -> Result<KeyValue, SteamError>
Calls a Web API function with the given HTTP method. The response is
requested as VDF and parsed into a KeyValue.
Sourcepub async fn call_protobuf<T>(
&self,
method: Method,
func: &str,
version: i32,
args: &[WebApiArgument],
) -> Result<T, SteamError>
pub async fn call_protobuf<T>( &self, method: Method, func: &str, version: i32, args: &[WebApiArgument], ) -> Result<T, SteamError>
Calls a Web API function and parses the protobuf response.
Sourcepub async fn call_protobuf_with_request<TResponse, TRequest>(
&self,
method: Method,
func: &str,
request: &TRequest,
version: i32,
extra_args: &[WebApiArgument],
) -> Result<WebAPIResponse<TResponse>, SteamError>
pub async fn call_protobuf_with_request<TResponse, TRequest>( &self, method: Method, func: &str, request: &TRequest, version: i32, extra_args: &[WebApiArgument], ) -> Result<WebAPIResponse<TResponse>, SteamError>
Calls a Web API function with a protobuf request and parses the protobuf
response. The request goes base64-encoded in input_protobuf_encoded;
the result code comes from the x-eresult response header.
Auto Trait Implementations§
impl !Freeze for AsyncInterface
impl !RefUnwindSafe for AsyncInterface
impl !UnwindSafe for AsyncInterface
impl Send for AsyncInterface
impl Sync for AsyncInterface
impl Unpin for AsyncInterface
impl UnsafeUnpin for AsyncInterface
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