Expand description
Generated Telegram API types, functions and enums.
This crate is auto-generated from the TL schema files in tl/.
To update for a new API layer, replace tl/api.tl and rebuild.
§Overview
| Module | Contents |
|---|---|
types | Concrete constructors (bare types) as structs |
functions | RPC functions as structs implementing RemoteCall |
enums | Boxed types as enums implementing Deserializable |
§Raw API usage
use layer_tl_types::{functions, Serializable};
let req = functions::auth::SendCode {
phone_number: "+1234567890".into(),
api_id: 12345,
api_hash: "abc".into(),
settings: Default::default(),
};
let bytes = req.to_bytes();
// Send `bytes` over an MTProto connection…§Updating to a new layer
- Replace
tl/api.tlwith the new schema. cargo build— the build script regenerates everything.
Re-exports§
pub use deserialize::Cursor;pub use deserialize::Deserializable;pub use serialize::Serializable;
Modules§
- deserialize
- The
Deserializabletrait,Cursorbuffer, and primitive impls. - enums
- functions
- serialize
- The
Serializabletrait and its implementations for primitive TL types. - types
Structs§
- Blob
- Opaque blob of bytes that should be passed through without interpretation.
- RawVec
- Bare vector —
vector(lowercase) as opposed to the boxedVector.
Constants§
- LAYER
- The API layer this code was generated from.
Traits§
- Identifiable
- Every generated type has a unique 32-bit constructor ID.
- Remote
Call - Marks a function type that can be sent to Telegram as an RPC call.