mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-06 06:53:32 -04:00
08665dcd1c880dd41c604b8cfc7c8710ab9298d2
future_to_promise helper to simplify code.
`wasm_bindgen_future::future_to_promise` expects a `Future<Output = Result<JsValue, JsValue>>`. We reimplement this function by expecting a `Future<Output = Result<T, anyhow::Error>>` where `T: Into<JsValue>`. That way, we apply the type conversions to `JsValue` inside this helper rather than in the call site. Additionally, all errors are managed automatically without having to deal with `JsError` or `JsValue`. It makes the code simpler to read and easier to write from my point of view.
matrix-rust-sdk
matrix-rust-sdk is an implementation of a Matrix client-server library in Rust.
Project structure
The rust-sdk consists of multiple crates that can be picked at your convenience:
- matrix-sdk - High level client library, with batteries included, you're most likely interested in this.
- matrix-sdk-base - No (network) IO client state machine that can be used to embed a Matrix client in your project or build a full fledged network enabled client lib on top of it.
- matrix-sdk-crypto - No (network) IO encryption state machine that can be used to add Matrix E2EE support to your client or client library.
Minimum Supported Rust Version (MSRV)
These crates are built with the Rust language version 2021 and require a minimum compiler version of 1.60
Status
The library is in an alpha state, things that are implemented generally work but the API will change in breaking ways.
If you are interested in using the matrix-sdk now is the time to try it out and provide feedback.
License
Description
Languages
Rust
99.7%
HTML
0.2%