42 releases (27 stable)
100.100.100 |
|
---|---|
1.8.1 | Jan 29, 2022 |
1.7.1 | Aug 24, 2021 |
1.7.0 | Feb 15, 2021 |
0.2.1 | Jun 12, 2019 |
#688 in Data structures
571 downloads per month
Used in telegram-client
4MB
82K
SLoC
rtdlib
rtdlib
is td for rust.
rtdlib
crate have td type (classes).
Usage
[dependencies]
rtdlib = "1.8.*"
The default, rtdlib
only have td
types, not have call tdjson dylib, if you want , you need add features
to your dependency.
[dependencies]
rtdlib = { version = "1.8.*", features = "sys" }
version
Please read: version
Example
types
let json = r#"{"@type":"updateAuthorizationState","authorization_state":{"@type":"authorizationStateWaitTdlibParameters"}}"#;
let state: UpdateAuthorizationState = serde_json::from_str(&json[..]).expect("Json fail");
assert_eq!("updateAuthorizationState", state.td_name());
let rjson = state.to_json();
assert!(rjson.is_ok(), true);
assert_eq!(json, rjson.unwrap());
tdjson
If you enable sys
features, you can use Tdlib
to call tdjson dylib.
use rtdlib::Tdlib;
let tdlib = Tdlib::new();
let request = r#"{"@type": "getMe"}"#;
tdlib.send(request);
td
More document you need check telegram api
Dependencies
~2–3.5MB
~61K SLoC