[][src]Struct rust_tdlib::client::client::Client

pub struct Client<A, S> where
    A: AuthStateHandler + Send + Sync + 'static,
    S: TdLibClient + Send + Sync + Clone + 'static, 
{ /* fields omitted */ }

A high-level abstraction of TDLib. Before start any API interactions you must call start().await.

Implementations

impl Client<ConsoleAuthStateHandler, RawApi>[src]

impl<A, S> Client<A, S> where
    A: AuthStateHandler + Send + Sync + 'static,
    S: TdLibClient + Send + Sync + Clone + 'static, 
[src]

pub fn api(&self) -> &Api<S>[src]

Returns instance of Api. Api implements all TDlib API-methods, such as "search_public_chat", "send_message" and so on.

pub async fn start(&mut self) -> Result<JoinHandle<ClientState>, RTDError>[src]

Starts interaction with TDLib. Method blocks until authorization performed. It returns JoinHandle which allows you to handle client state.

pub fn stop(&self)[src]

Stops the client. You may want to await JoinHandle retrieved with client.start().await after stopping the client.

Trait Implementations

impl<A: Clone, S: Clone> Clone for Client<A, S> where
    A: AuthStateHandler + Send + Sync + 'static,
    S: TdLibClient + Send + Sync + Clone + 'static, 
[src]

impl<A: Debug, S: Debug> Debug for Client<A, S> where
    A: AuthStateHandler + Send + Sync + 'static,
    S: TdLibClient + Send + Sync + Clone + 'static, 
[src]

Auto Trait Implementations

impl<A, S> !RefUnwindSafe for Client<A, S>[src]

impl<A, S> Send for Client<A, S>[src]

impl<A, S> Sync for Client<A, S>[src]

impl<A, S> Unpin for Client<A, S> where
    S: Unpin
[src]

impl<A, S> !UnwindSafe for Client<A, S>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,