pub enum TimeoutError<E> {
Timeout {
duration: Duration,
context: String,
},
ExecutionError(E),
}Expand description
Errors that can occur during timeout-wrapped execution.
Variants§
Timeout
The operation timed out.
Fields
ExecutionError(E)
The operation completed but returned an error.
Implementations§
Source§impl<E> TimeoutError<E>
impl<E> TimeoutError<E>
Sourcepub fn is_timeout(&self) -> bool
pub fn is_timeout(&self) -> bool
Check if this is a timeout error.
Sourcepub fn is_execution_error(&self) -> bool
pub fn is_execution_error(&self) -> bool
Check if this is an execution error.
Sourcepub fn timeout_duration(&self) -> Option<Duration>
pub fn timeout_duration(&self) -> Option<Duration>
Get the duration if this is a timeout error.
Trait Implementations§
Source§impl<E: Debug> Debug for TimeoutError<E>
impl<E: Debug> Debug for TimeoutError<E>
Source§impl<E> Display for TimeoutError<E>where
E: Display,
impl<E> Display for TimeoutError<E>where
E: Display,
Source§impl<E> Error for TimeoutError<E>
impl<E> Error for TimeoutError<E>
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl<E> Freeze for TimeoutError<E>where
E: Freeze,
impl<E> RefUnwindSafe for TimeoutError<E>where
E: RefUnwindSafe,
impl<E> Send for TimeoutError<E>where
E: Send,
impl<E> Sync for TimeoutError<E>where
E: Sync,
impl<E> Unpin for TimeoutError<E>where
E: Unpin,
impl<E> UnsafeUnpin for TimeoutError<E>where
E: UnsafeUnpin,
impl<E> UnwindSafe for TimeoutError<E>where
E: 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