pub enum WaitForCompletionOrTerminateResult<T = ExitStatus> {
Completed(T),
TerminatedAfterTimeout {
result: T,
timeout: Duration,
},
}Expand description
Result of waiting for a process to complete, terminating it if the wait times out.
Variants§
Completed(T)
The process completed before the wait timeout elapsed.
TerminatedAfterTimeout
The wait timeout elapsed, then cleanup termination completed successfully.
Implementations§
Source§impl<T> WaitForCompletionOrTerminateResult<T>
impl<T> WaitForCompletionOrTerminateResult<T>
Sourcepub fn into_result(self) -> T
pub fn into_result(self) -> T
Returns the terminal value, whether completion happened before timeout or after cleanup.
Sourcepub fn into_completed(self) -> Option<T>
pub fn into_completed(self) -> Option<T>
Returns the completed value, or None if cleanup termination was required after timeout.
Sourcepub fn expect_completed(self, message: &str) -> T
pub fn expect_completed(self, message: &str) -> T
Returns the completed value, panicking with message if cleanup termination was required.
§Panics
Panics with message if this result is
WaitForCompletionOrTerminateResult::TerminatedAfterTimeout.
Trait Implementations§
Source§impl<T: Clone> Clone for WaitForCompletionOrTerminateResult<T>
impl<T: Clone> Clone for WaitForCompletionOrTerminateResult<T>
Source§fn clone(&self) -> WaitForCompletionOrTerminateResult<T>
fn clone(&self) -> WaitForCompletionOrTerminateResult<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for WaitForCompletionOrTerminateResult<T>
impl<T: Debug> Debug for WaitForCompletionOrTerminateResult<T>
Source§impl<T: PartialEq> PartialEq for WaitForCompletionOrTerminateResult<T>
impl<T: PartialEq> PartialEq for WaitForCompletionOrTerminateResult<T>
Source§fn eq(&self, other: &WaitForCompletionOrTerminateResult<T>) -> bool
fn eq(&self, other: &WaitForCompletionOrTerminateResult<T>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<T: Copy> Copy for WaitForCompletionOrTerminateResult<T>
impl<T: Eq> Eq for WaitForCompletionOrTerminateResult<T>
impl<T> StructuralPartialEq for WaitForCompletionOrTerminateResult<T>
Auto Trait Implementations§
impl<T> Freeze for WaitForCompletionOrTerminateResult<T>where
T: Freeze,
impl<T> RefUnwindSafe for WaitForCompletionOrTerminateResult<T>where
T: RefUnwindSafe,
impl<T> Send for WaitForCompletionOrTerminateResult<T>where
T: Send,
impl<T> Sync for WaitForCompletionOrTerminateResult<T>where
T: Sync,
impl<T> Unpin for WaitForCompletionOrTerminateResult<T>where
T: Unpin,
impl<T> UnsafeUnpin for WaitForCompletionOrTerminateResult<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for WaitForCompletionOrTerminateResult<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