Skip to main content

Crate ferogram_tl_types

Crate ferogram_tl_types 

Source
Expand description

Auto-generated Telegram API types, functions, and enums for TL Layer 224.

This crate is part of ferogram, an async Rust MTProto client built by Ankit Chaubey.

The entire contents are generated at build time from the TL schema in tl/. Do not edit the generated source by hand.

Most users access this through ferogram::tl, which re-exports everything here. Use this crate directly only if you are building on top of the raw TL layer without the high-level ferogram client.

§Modules

ModuleContents
typesConcrete constructors as structs (bare types)
functionsRPC functions as structs implementing RemoteCall
enumsBoxed types as enums implementing Deserializable

§Serialization

Every type in types and every function in functions implements Serializable. Every enum in enums implements Deserializable.

use ferogram_tl_types::{functions, Serializable};

let req = functions::help::GetConfig {};
let bytes = req.to_bytes();
// bytes is the TL-serialized wire form, ready to send over MTProto.

§Feature flags

FlagEffect
tl-apiLayer 224 API schema types (default in ferogram)
tl-mtprotoMTProto internal types (DH, transport, etc.)
name-for-idname_for_id(u32) -> &'static str for debug printing

§Updating to a new TL layer

Replace tl/api.tl with the new schema and run cargo build. The build script regenerates all source. The LAYER constant reflects the current layer number.

Re-exports§

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

Modules§

deserialize
enums
functions
serialize
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.

Functions§

name_for_idname-for-id
Returns the TL name for a known constructor ID.