Struct rust_tdlib::client::worker::Worker[][src]

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

The main object in all interactions. You have to [start](crate::client::worker::Worker::start] worker and bind each client with worker using auth_client.

Implementations

impl Worker<ConsoleAuthStateHandler, TdJson>[src]

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

pub async fn auth_client(
    &mut self,
    client: Client<T>
) -> RTDResult<(JoinHandle<ClientState>, Client<T>)>
[src]

Binds client with worker and runs authorization routines. Method returns error if worker is not running.

pub fn is_running(&self) -> bool[src]

Determines that the worker is running.

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

Starts interaction with TDLib. It returns JoinHandle which allows you to handle worker 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 Worker<A, S> where
    A: AuthStateHandler + Send + Sync + 'static,
    S: TdLibClient + Send + Sync + Clone + 'static, 
[src]

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

Auto Trait Implementations

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

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

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

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

impl<A, S> !UnwindSafe for Worker<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>,