[][src]Struct paho_mqtt::token::Token

pub struct Token { /* fields omitted */ }

A Token is a mechanism for tracking the progress of an asynchronous operation.

Implementations

impl Token[src]

pub fn new() -> Token

Notable traits for Token

impl Future for Token type Output = Result<ServerResponse>;
[src]

Creates a new, unsignaled Token.

pub fn from_request(req: ServerRequest) -> Token

Notable traits for Token

impl Future for Token type Output = Result<ServerResponse>;
[src]

Creates a token for a specific request type

pub fn from_client<FS, FF>(
    cli: &AsyncClient,
    req: ServerRequest,
    success_cb: FS,
    failure_cb: FF
) -> Token

Notable traits for Token

impl Future for Token type Output = Result<ServerResponse>;
where
    FS: Fn(&AsyncClient, u16) + 'static,
    FF: Fn(&AsyncClient, u16, i32) + 'static, 
[src]

Creates a new, un-signaled Token with callbacks.

pub fn from_error(rc: i32) -> Token

Notable traits for Token

impl Future for Token type Output = Result<ServerResponse>;
[src]

Creates a new Token signaled with an error code.

pub fn from_success() -> Token

Notable traits for Token

impl Future for Token type Output = Result<ServerResponse>;
[src]

Creates a new Token signaled with a "success" return code.

pub fn wait(self) -> Result<ServerResponse>[src]

Blocks the caller until the asynchronous operation completes.

pub fn try_wait(&mut self) -> Option<Result<ServerResponse>>[src]

Non-blocking check to see if the token is complete.

Returns None if the operation is still in progress, otherwise returns the result of the operation which can be an error or, on success, the response from the server.

pub fn wait_for(self, dur: Duration) -> Result<ServerResponse>[src]

Blocks the caller a limited amount of time waiting for the asynchronous operation to complete.

Trait Implementations

impl Clone for Token[src]

impl Future for Token[src]

type Output = Result<ServerResponse>

The type of value produced on completion.

pub fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>[src]

Poll the token to see if the request has completed yet.

impl Into<Token> for DeliveryToken[src]

pub fn into(self) -> Token

Notable traits for Token

impl Future for Token type Output = Result<ServerResponse>;
[src]

Converts the delivery token into a Token

impl Send for Token[src]

Auto Trait Implementations

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> FutureExt for T where
    T: Future + ?Sized
[src]

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

impl<F> IntoFuture for F where
    F: Future
[src]

type Output = <F as Future>::Output

🔬 This is a nightly-only experimental API. (into_future)

The output that the future will produce on completion.

type Future = F

🔬 This is a nightly-only experimental API. (into_future)

Which kind of future are we turning this into?

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<F, T, E> TryFuture for F where
    F: Future<Output = Result<T, E>> + ?Sized
[src]

type Ok = T

The type of successful values yielded by this future

type Error = E

The type of failures yielded by this future

impl<Fut> TryFutureExt for Fut where
    Fut: TryFuture + ?Sized
[src]

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.