pub enum TimeoutResult<T, E> {
Ok(T),
Err(BoxedComposableError<E>),
Timeout(Duration),
}Expand description
Result type for timeout operations that can fail with either the inner error or a timeout.
Variants§
Ok(T)
Operation completed successfully.
Err(BoxedComposableError<E>)
Operation failed with an error.
Timeout(Duration)
Operation timed out.
Implementations§
Source§impl<T, E> TimeoutResult<T, E>
impl<T, E> TimeoutResult<T, E>
Sourcepub const fn is_timeout(&self) -> bool
pub const fn is_timeout(&self) -> bool
Returns true if the operation timed out.
Sourcepub fn into_result(self) -> BoxedComposableResult<T, E>where
E: From<TimeoutError>,
pub fn into_result(self) -> BoxedComposableResult<T, E>where
E: From<TimeoutError>,
Converts to a standard Result, treating timeout as an error message.
Trait Implementations§
Auto Trait Implementations§
impl<T, E> Freeze for TimeoutResult<T, E>where
T: Freeze,
impl<T, E> RefUnwindSafe for TimeoutResult<T, E>where
T: RefUnwindSafe,
E: RefUnwindSafe,
impl<T, E> Send for TimeoutResult<T, E>
impl<T, E> Sync for TimeoutResult<T, E>
impl<T, E> Unpin for TimeoutResult<T, E>where
T: Unpin,
impl<T, E> UnwindSafe for TimeoutResult<T, E>where
T: UnwindSafe,
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