pub struct ThrottleError<T>(/* private fields */);
Expand description
Either the error of the underlying stream, or an error within tokio’s timing machinery.
Implementations§
Source§impl<T> ThrottleError<T>
impl<T> ThrottleError<T>
Sourcepub fn from_stream_err(err: T) -> Self
pub fn from_stream_err(err: T) -> Self
Creates a new ThrottleError
from the given stream error.
Sourcepub fn from_timer_err(err: Error) -> Self
pub fn from_timer_err(err: Error) -> Self
Creates a new ThrottleError
from the given tokio timer error.
Sourcepub fn get_stream_error(&self) -> Option<&T>
pub fn get_stream_error(&self) -> Option<&T>
Attempts to get the underlying stream error, if it is present.
Sourcepub fn get_timer_error(&self) -> Option<&Error>
pub fn get_timer_error(&self) -> Option<&Error>
Attempts to get the underlying timer error, if it is present.
Sourcepub fn into_stream_error(self) -> Option<T>
pub fn into_stream_error(self) -> Option<T>
Attempts to extract the underlying stream error, if it is present.
Sourcepub fn into_timer_error(self) -> Option<Error>
pub fn into_timer_error(self) -> Option<Error>
Attempts to extract the underlying timer error, if it is present.
Sourcepub fn is_stream_error(&self) -> bool
pub fn is_stream_error(&self) -> bool
Returns whether the throttle error has occured because of an error in the underlying stream.
Sourcepub fn is_timer_error(&self) -> bool
pub fn is_timer_error(&self) -> bool
Returns whether the throttle error has occured because of an error in tokio’s timer system.
Trait Implementations§
Source§impl<T: Debug> Debug for ThrottleError<T>
impl<T: Debug> Debug for ThrottleError<T>
Source§impl<T: StdError> Display for ThrottleError<T>
impl<T: StdError> Display for ThrottleError<T>
Source§impl<T: StdError + 'static> Error for ThrottleError<T>
impl<T: StdError + 'static> Error for ThrottleError<T>
Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§fn cause(&self) -> Option<&dyn StdError>
fn cause(&self) -> Option<&dyn StdError>
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Auto Trait Implementations§
impl<T> Freeze for ThrottleError<T>where
T: Freeze,
impl<T> RefUnwindSafe for ThrottleError<T>where
T: RefUnwindSafe,
impl<T> Send for ThrottleError<T>where
T: Send,
impl<T> Sync for ThrottleError<T>where
T: Sync,
impl<T> Unpin for ThrottleError<T>where
T: Unpin,
impl<T> UnwindSafe for ThrottleError<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more