Rust SDK: the hatang crate on crates.io
Ha Tang has an official Rust SDK. The hatang crate calls the API from axum, actix-web, workers and CLIs: plans and purchases on the customer's profile, the AI assistant's knowledge, conversations and customers, email, VietQR payments, and webhook and IPN verification. It has the same namespaces as the Python SDK.
cargo add hatang
cargo add hatang --features blocking # a synchronous client too
| Release | hatang 0.1.1 (crates.io) |
| API reference | docs.rs/hatang |
| Rust | 1.89 or later |
| Clients | Hatang (async, reqwest with rustls) and blocking::Hatang with the blocking feature |
- Bodies take the crate's typed structs (
SendEmail,SubscriptionUpsert,PurchaseUpsert,KnowledgeDocument,ChatMessage,CreatePayment…) or anyserde::Serializevalue; responses areserde_json::Value. hatang::Errorgives the HTTP status (0 when Ha Tang was not reached), the API's error code andretryable()for unreachable, 429 and 5xx.construct_webhook_event,construct_ipn_event,identity_hashandpurchase_tokengive the same values as Ha Tang's servers and the other SDKs, and take anhttp::HeaderMapstraight from axum.
See the Rust SDK guide.