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

pub struct Token { /* fields omitted */ }

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

Methods

impl Token[src]

pub fn new() -> Token[src]

Creates a new, unsignaled Token.

pub fn from_request(req: ServerRequest) -> Token[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 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[src]

Creates a new Token signaled with an error code.

pub fn from_success() -> Token[src]

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

pub fn wait_for(self, dur: Duration) -> MqttResult<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 Item = ServerResponse

The type of value that this future will resolved with if it is successful. Read more

type Error = MqttError

The type of error that this future will resolve with if it fails in a normal fashion. Read more

fn poll(&mut self) -> Result<Async<Self::Item>, Self::Error>[src]

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

impl Into<Token> for DeliveryToken[src]

fn into(self) -> Token[src]

Converts the delivery token into a Token

impl Send for Token[src]

Auto Trait Implementations

impl !RefUnwindSafe for Token

impl !Sync for Token

impl Unpin for Token

impl !UnwindSafe for Token

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<F> FutureExt for F where
    F: Future
[src]

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

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

type Future = F

The future that this type can be converted into.

type Item = <F as Future>::Item

The item that the future may resolve with.

type Error = <F as Future>::Error

The error that the future may resolve with.

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.