wx_sdk/
lib.rs

1//! # wx-sdk API Documentation
2//! ## `wx-sdk` is a [WeChat SDK](https://mp.weixin.qq.com/) written in [Rust](https://www.rust-lang.org/).
3//! ## Features
4//! Fealtures can be checked at [README page](https://github.com/ilovelll/wx-sdk/blob/main/README.md)
5
6//! ## QuickStart
7
8//! First, please refer to this [page](https://developers.weixin.qq.com/doc/offiaccount/Basic_Information/Access_Overview.html) to provide these values: `token`, `EncodingAESKey`,`EncodingMode`.
9//! ```
10//! use wx_sdk::wechat::{WxSdk};
11//! use wx_sdk::mp::{ServerConfig, EncodingMode};
12//!
13//! let sdk = WxSdk::new_with_default_token_client("app_id", "app_secret");
14//!
15//! // Then, you can use the sdk functions, like get current menu info:
16//!
17//! let config = ServerConfig::new("token", EncodingMode::Plain);
18//! let mpsdk = sdk.mp(config);
19//! async {
20//!    let menu = mpsdk.menu().get_current_selfmenu_info().await;
21//! };
22//! ```
23
24//! ## Contributing
25
26//! Issue reports and Pull Requests are always welcome!
27
28//! ## License
29
30//! wx-sdk is available under the [_MIT License_](https://github.com/ilovelll/wx-sdk/blob/main/LICENSE)
31
32pub mod access_token;
33
34pub use access_token::AccessToken;
35
36pub mod error;
37pub use error::SdkResult;
38pub(crate) mod cache;
39pub(crate) mod utils;
40pub mod wechat;
41pub use access_token::TokenClient;
42pub use wechat::WxSdk;
43#[cfg(feature = "mp")]
44pub mod mp;
45
46#[cfg(feature = "wxa")]
47pub mod wxa;
48
49#[cfg(feature = "pay")]
50pub mod pay;