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 */ }
Expand description
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 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]
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]
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]
pub fn is_running(&self) -> bool
[src]Determines that the worker is running.
pub fn start(&mut self) -> JoinHandle<ClientState>
[src]
pub fn start(&mut self) -> JoinHandle<ClientState>
[src]Starts interaction with TDLib. It returns JoinHandle which allows you to handle worker state.
Trait Implementations
Auto Trait Implementations
impl<A, S> !RefUnwindSafe for Worker<A, S>
impl<A, S> Send for Worker<A, S>
impl<A, S> Sync for Worker<A, S>
impl<A, S> Unpin for Worker<A, S> where
S: Unpin,
S: Unpin,
impl<A, S> !UnwindSafe for Worker<A, S>
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more