tencentcloud_sms_sdk/
lib.rs

1//! # TencentCloud SMS SDK for Rust
2//!
3//! This crate provides a Rust implementation of the TencentCloud SMS SDK,
4//! allowing you to send SMS messages through TencentCloud's SMS service.
5//!
6//! ## Features
7//!
8//! - Send SMS messages (verification codes, notifications, marketing)
9//! - Support for both domestic and international SMS
10//! - Async/await support with tokio
11//! - TC3-HMAC-SHA256 signature algorithm
12//! - Comprehensive error handling
13//!
14//! ## Basic Usage
15//!
16//! ```rust,no_run
17//! use tencentcloud_sms_sdk::{Client, Credential, SendSmsRequest};
18//!
19//! #[tokio::main]
20//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
21//!     // Create credentials
22//!     let credential = Credential::new("your_secret_id", "your_secret_key", None);
23//!     
24//!     // Create client
25//!     let client = Client::new(credential, "ap-guangzhou");
26//!     
27//!     // Create request
28//!     let request = SendSmsRequest::new(
29//!         vec!["+8613800000000".to_string()],
30//!         "1400000000",
31//!         "123456",
32//!         "YourSignature",
33//!         vec!["123456".to_string()],
34//!     );
35//!     
36//!     // Send SMS
37//!     let response = client.send_sms(request).await?;
38//!     println!("SMS sent successfully: {:?}", response);
39//!     
40//!     Ok(())
41//! }
42//! ```
43
44pub mod core;
45pub mod error;
46pub mod sms;
47
48// Re-export main types for convenient usage
49pub use crate::core::{Client, ClientProfile, Credential, HttpProfile};
50pub use crate::error::{Result, TencentCloudError};
51pub use crate::sms::{SendSmsRequest, SendSmsResponse, SendStatus};
52
53/// Initialize the SDK (placeholder for future initialization needs)
54pub fn init_api() {
55    // Currently no initialization needed, but keeping for API compatibility
56}
57
58/// Shutdown the SDK (placeholder for future cleanup needs)
59pub fn shutdown_api() {
60    // Currently no cleanup needed, but keeping for API compatibility
61}