rtdlib
rtdlib is td for rust.
rtdlib crate have td type (classes). and tdjson binding. if use rtdlib you need include libtdjson.so to you build path.
Usage
0.*
[]
= "0.*"
1.3.*
[]
= "1.3.*"
1.4.*
[]
= "1.4.*"
1.5.*
[]
= "1.5.*"
1.6.*
[]
= "1.6.*"
version
Since the rtdlib version follows td, a version number less than 100 is reserved for td release.
Version mapping
| rtdlib | td |
|---|---|
| 0.* | master |
| 1.3.* | 1.3.* |
| 1.4.* | 1.4.* |
| 1.5.* | 1.5.* |
| 1.6.* | 1.6.* |
Example
types
let json = r#"{"@type":"updateAuthorizationState","authorization_state":{"@type":"authorizationStateWaitTdlibParameters"}}"#;
let state: UpdateAuthorizationState = from_str.expect;
assert_eq!;
let rjson = state.to_json;
assert!;
assert_eq!;
tdjson
use Tdlib;
let tdlib = new;
let request = r#"{"@type": "getMe"}"#;
tdlib.send;
td
More document you need check telegram api
How include libtdjson.so
The first you need read td know how to build td.
And then, when you have libtdjson.so copy this file to /usr/lib.
Or set an environment
In the development phase, you can set RUSTFLAGS environment to you IDE.