Trait ClientTrait

Source
pub trait ClientTrait {
Show 13 methods // Required methods fn access_token( &self, ) -> impl Future<Output = Result<String, WechatError>> + Send; fn refresh_access_token( &mut self, ) -> impl Future<Output = Result<(), WechatError>> + Send; fn http_client(&self) -> &Client; // Provided methods fn url_with_query<I, K, V>( &self, url: &str, queries: I, ) -> Result<Url, WechatError> where I: IntoIterator, <I as IntoIterator>::Item: Borrow<(K, V)>, K: AsRef<str>, V: AsRef<str> { ... } fn authorized_url( &self, url: &str, ) -> impl Future<Output = Result<Url, WechatError>> + Send where Self: Sync { ... } fn get_empty<R, U>( &self, url: U, ) -> impl Future<Output = Result<R, WechatError>> + Send where R: DeserializeOwned, U: IntoUrl + Send, Self: Sync { ... } fn get<R, U, T>( &self, url: U, query: &T, ) -> impl Future<Output = Result<R, WechatError>> + Send where R: DeserializeOwned, U: IntoUrl + Send, T: Serialize + Sync + ?Sized, Self: Sync { ... } fn post_empty<R, U>( &self, url: U, ) -> impl Future<Output = Result<R, WechatError>> + Send where R: DeserializeOwned, U: IntoUrl + Send, Self: Sync { ... } fn post<R, U, T>( &self, url: U, data: &T, ) -> impl Future<Output = Result<R, WechatError>> + Send where R: DeserializeOwned, U: IntoUrl + Send, T: Serialize + Sync + ?Sized, Self: Sync { ... } fn upload<R, U>( &self, url: U, multipart: Form, ) -> impl Future<Output = Result<R, WechatError>> + Send where R: DeserializeOwned, U: IntoUrl + Send, Self: Sync { ... } fn upload_with<R, U, T>( &self, url: U, data: &T, multipart: Form, ) -> impl Future<Output = Result<R, WechatError>> + Send where R: DeserializeOwned, U: IntoUrl + Send, T: Serialize + Sync + ?Sized, Self: Sync { ... } fn json<R, U, T>( &self, url: U, data: &T, ) -> impl Future<Output = Result<R, WechatError>> + Send where R: DeserializeOwned, U: IntoUrl + Send, T: Serialize + Sync + ?Sized, Self: Sync { ... } fn download<U, T>( &self, url: U, query: &T, ) -> impl Future<Output = Result<Vec<u8>, WechatError>> + Send where U: IntoUrl + Send, T: Serialize + Sync + ?Sized, Self: Sync { ... }
}

Required Methods§

Source

fn access_token( &self, ) -> impl Future<Output = Result<String, WechatError>> + Send

Source

fn refresh_access_token( &mut self, ) -> impl Future<Output = Result<(), WechatError>> + Send

Source

fn http_client(&self) -> &Client

Provided Methods§

Source

fn url_with_query<I, K, V>( &self, url: &str, queries: I, ) -> Result<Url, WechatError>
where I: IntoIterator, <I as IntoIterator>::Item: Borrow<(K, V)>, K: AsRef<str>, V: AsRef<str>,

Source

fn authorized_url( &self, url: &str, ) -> impl Future<Output = Result<Url, WechatError>> + Send
where Self: Sync,

Source

fn get_empty<R, U>( &self, url: U, ) -> impl Future<Output = Result<R, WechatError>> + Send
where R: DeserializeOwned, U: IntoUrl + Send, Self: Sync,

Source

fn get<R, U, T>( &self, url: U, query: &T, ) -> impl Future<Output = Result<R, WechatError>> + Send
where R: DeserializeOwned, U: IntoUrl + Send, T: Serialize + Sync + ?Sized, Self: Sync,

Source

fn post_empty<R, U>( &self, url: U, ) -> impl Future<Output = Result<R, WechatError>> + Send
where R: DeserializeOwned, U: IntoUrl + Send, Self: Sync,

Source

fn post<R, U, T>( &self, url: U, data: &T, ) -> impl Future<Output = Result<R, WechatError>> + Send
where R: DeserializeOwned, U: IntoUrl + Send, T: Serialize + Sync + ?Sized, Self: Sync,

Source

fn upload<R, U>( &self, url: U, multipart: Form, ) -> impl Future<Output = Result<R, WechatError>> + Send
where R: DeserializeOwned, U: IntoUrl + Send, Self: Sync,

Source

fn upload_with<R, U, T>( &self, url: U, data: &T, multipart: Form, ) -> impl Future<Output = Result<R, WechatError>> + Send
where R: DeserializeOwned, U: IntoUrl + Send, T: Serialize + Sync + ?Sized, Self: Sync,

Source

fn json<R, U, T>( &self, url: U, data: &T, ) -> impl Future<Output = Result<R, WechatError>> + Send
where R: DeserializeOwned, U: IntoUrl + Send, T: Serialize + Sync + ?Sized, Self: Sync,

Source

fn download<U, T>( &self, url: U, query: &T, ) -> impl Future<Output = Result<Vec<u8>, WechatError>> + Send
where U: IntoUrl + Send, T: Serialize + Sync + ?Sized, Self: Sync,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§