Skip to main content

Crate layer_tl_types

Crate layer_tl_types 

Source
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

ModuleContents
typesConcrete constructors (bare types) as structs
functionsRPC functions as structs implementing RemoteCall
enumsBoxed 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

  1. Replace tl/api.tl with the new schema.
  2. cargo build — the build script regenerates everything.

Re-exports§

pub use deserialize::Cursor;
pub use deserialize::Deserializable;
pub use serialize::Serializable;

Modules§

deserialize
The Deserializable trait, Cursor buffer, and primitive impls.
enums
functions
serialize
The Serializable trait 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 boxed Vector.

Constants§

LAYER
The API layer this code was generated from.

Traits§

Identifiable
Every generated type has a unique 32-bit constructor ID.
RemoteCall
Marks a function type that can be sent to Telegram as an RPC call.