Struct ClientBuilder

Source
pub struct ClientBuilder<R, A>
where R: TdLibClient + Clone, A: ClientAuthStateHandler + Clone + 'static,
{ /* private fields */ }

Implementations§

Source§

impl<R, A> ClientBuilder<R, A>
where R: TdLibClient + Clone, A: ClientAuthStateHandler + Clone,

Source

pub fn with_updates_sender(self, updates_sender: Sender<Box<Update>>) -> Self

If you want to receive Telegram updates (messages, channels, etc; see crate::types::Update), you must set mpsc::Sender here.

Source

pub fn with_auth_state_channel(self, channel_size: usize) -> Self

If you want to receive all (AuthorizationState)[crate::types::authorization_state::AuthorizationState] changes you have to specify positive number of (channel)tokio::sync::mpsc::channel size. Channel will be used to send state changes.

Source

pub fn with_tdlib_parameters(self, tdlib_parameters: TdlibParameters) -> Self

Base parameters for your TDlib instance.

Source

pub fn with_client_auth_state_handler<NA: ClientAuthStateHandler + Clone>( self, auth_handler: NA, ) -> ClientBuilder<R, NA>

Use it to bound specific auth handler with a client.

Source

pub fn build(self) -> Result<Client<R>>

Trait Implementations§

Source§

impl<R, A> Debug for ClientBuilder<R, A>
where R: TdLibClient + Clone + Debug, A: ClientAuthStateHandler + Clone + 'static + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ClientBuilder<TdJson, ConsoleClientStateHandler>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<R, A> Freeze for ClientBuilder<R, A>
where R: Freeze, A: Freeze,

§

impl<R, A> RefUnwindSafe for ClientBuilder<R, A>

§

impl<R, A> Send for ClientBuilder<R, A>
where R: Send,

§

impl<R, A> Sync for ClientBuilder<R, A>
where R: Sync,

§

impl<R, A> Unpin for ClientBuilder<R, A>
where R: Unpin, A: Unpin,

§

impl<R, A> UnwindSafe for ClientBuilder<R, A>
where R: UnwindSafe, A: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.