pub struct RunControl { /* private fields */ }Expand description
Cancellation and a monotonic deadline; contains no runtime-specific types.
Implementations§
Source§impl RunControl
impl RunControl
Sourcepub fn with_deadline(deadline: Instant) -> Self
pub fn with_deadline(deadline: Instant) -> Self
Bind to an already established monotonic execution deadline.
Sourcepub fn new(timeout: Duration) -> Self
pub fn new(timeout: Duration) -> Self
Constructs a deadline. An unrepresentable duration fails closed as an
immediately expired control; use try_new to report invalid input.
Sourcepub fn try_new(timeout: Duration) -> Result<Self>
pub fn try_new(timeout: Duration) -> Result<Self>
Constructs a deadline, rejecting durations that overflow the host clock.
pub fn cancel(&self)
pub fn deadline(&self) -> Instant
pub fn is_cancelled(&self) -> bool
pub fn check(&self) -> Result<()>
Trait Implementations§
Source§impl Clone for RunControl
impl Clone for RunControl
Auto Trait Implementations§
impl Freeze for RunControl
impl RefUnwindSafe for RunControl
impl Send for RunControl
impl Sync for RunControl
impl Unpin for RunControl
impl UnsafeUnpin for RunControl
impl UnwindSafe for RunControl
Blanket Implementations§
impl<T> ArtifactLease for T
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