Struct rust_tdlib::client::worker::Worker [−][src]
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]
pub fn builder() -> WorkerBuilder<ConsoleAuthStateHandler, TdJson>
[src]
impl<A, T> Worker<A, T> where
A: AuthStateHandler + Send + Sync + 'static,
T: TdLibClient + Send + Sync + Clone + 'static,
[src]
A: AuthStateHandler + Send + Sync + 'static,
T: TdLibClient + Send + Sync + Clone + 'static,
pub async fn auth_client(
&mut self,
client: Client<T>
) -> RTDResult<(JoinHandle<ClientState>, Client<T>)>
[src]
&mut self,
client: Client<T>
) -> RTDResult<(JoinHandle<ClientState>, Client<T>)>
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]
A: AuthStateHandler + Send + Sync + 'static,
S: TdLibClient + Send + Sync + Clone + 'static,
impl<A: Debug, S: Debug> Debug for Worker<A, S> where
A: AuthStateHandler + Send + Sync + 'static,
S: TdLibClient + Send + Sync + Clone + 'static,
[src]
A: AuthStateHandler + Send + Sync + 'static,
S: TdLibClient + Send + Sync + Clone + 'static,
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]
S: Unpin,
impl<A, S> !UnwindSafe for Worker<A, S>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,