Struct egg_mode::Response [] [src]

pub struct Response<T> {
    pub rate_limit: i32,
    pub rate_limit_remaining: i32,
    pub rate_limit_reset: i32,
    pub response: T,
}

A helper struct to wrap response data with accompanying rate limit information.

This is returned by any function that calls a rate-limited method on Twitter, to allow for inline checking of the rate-limit information without an extra call to service::rate_limit_info.

As this implements Deref and DerefMut, you can transparently use the contained response's methods as if they were methods on this struct.

Fields

The rate limit ceiling for the given request.

The number of requests left for the 15-minute window.

The UTC Unix timestamp at which the rate window resets.

The decoded response from the request.

Methods

impl<T> Response<T>
[src]

Convert a Response<T> to a Response<U> by running its contained response through the given function. This preserves its rate-limit information.

Note that this is not a member function, so as to not conflict with potential methods on the contained T.

Trait Implementations

impl<T: Debug> Debug for Response<T>
[src]

Formats the value using the given formatter.

impl<T> Deref for Response<T>
[src]

The resulting type after dereferencing

The method called to dereference a value

impl<T> DerefMut for Response<T>
[src]

The method called to mutably dereference a value

impl<T> IntoIterator for Response<Vec<T>>
[src]

Iteration over a response that returned a collection, copying the rate limit information across all values.

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

impl<T> FromIterator<Response<T>> for Response<Vec<T>>
[src]

FromIterator impl that allows collecting several responses into one, preserving the latest rate limit information.

Creates a value from an iterator. Read more