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