pub struct Client { /* private fields */ }

Implementations

Sets the verbosity level of the internal logging of TDLib.

By default the TDLib uses a log verbosity level of 5.

Parameters

level New value of logging verbosity level. Value 0 corresponds to fatal errors, value 1 corresponds to errors, value 2 corresponds to warnings and debug warnings, value 3 corresponds to informational, value 4 corresponds to debug, value 5 corresponds to verbose debug, value greater than 5 and up to 1024 can be used to enable even more logging.

Examples
use telegram_client::client::Client;
Client::set_log_verbosity_level(3);

Sets maximum size of the file to where the internal TDLib log is written before the file will be auto-rotated.

Unused if log is not written to a file. Defaults to 10 MB.

Parameters

size Maximum size of the file to where the internal TDLib log is written before the file will be auto-rotated. Should be positive.

Examples
use telegram_client::client::Client;
Client::set_log_max_file_size(1024 * 1024);

Sets the path to the file where the internal TDLib log will be written.

By default TDLib writes logs to stderr or an OS specific log. Use this method to write the log to a file instead.

Parameters

path Maybe path to a file where the internal TDLib log will be written. Use None to switch back to the default logging behaviour.

Examples
use telegram_client::client::Client;
Client::set_log_file_path(Some("/var/log/tdlib/tdlib.log"));

Creates a new Client with api

Examples
use telegram_client::client::Client;
use telegram_client::api::Api;
let client = Client::new(Api::default());

Start a Client.

Examples
use telegram_client::client::Client;
let client = Client::default();
client.start();

Start a daemon Client.

Examples
use telegram_client::client::Client;
let client = Client::default();
client.daemon("tgclient");

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Creates a default Client

Examples
use telegram_client::client::Client;
use telegram_client::api::Api;
let client = Client::new(Api::default());

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.