Struct tokio_timer::throttle::ThrottleError
source · pub struct ThrottleError<T>(_);
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