[−][src]Struct egg_mode::Response
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
rate_limit_status: RateLimitLatest rate lime status
response: TThe decoded response from the request.
Methods
impl<T> Response<T>[src]
impl<T> Response<T>[src]
pub fn map<F, U>(src: Response<T>, fun: F) -> Response<U> where
F: FnOnce(T) -> U, [src]
F: FnOnce(T) -> U,
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]
impl<T> Deref for Response<T>[src]
impl<T> DerefMut for Response<T>[src]
impl<'de, T> Deserialize<'de> for Response<T> where
T: Deserialize<'de>,
T: Default, [src]
T: Deserialize<'de>,
T: Default,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, [src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl<T> RefUnwindSafe for Response<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Response<T> where
T: Send,
T: Send,
impl<T> Sync for Response<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Response<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Response<T> where
T: UnwindSafe,
T: UnwindSafe,
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,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>, [src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
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.
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.
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>,