pub struct RunControl { /* private fields */ }Expand description
Collaborative drain control for graceful shutdown
Allows requesting that the graph stop at the next superstep boundary after saving a checkpoint.
Implementations§
Source§impl RunControl
impl RunControl
Sourcepub fn new() -> RunControl
pub fn new() -> RunControl
Create a new run control
Sourcepub fn request_drain(&self, reason: &str)
pub fn request_drain(&self, reason: &str)
Sourcepub fn drain_requested(&self) -> bool
pub fn drain_requested(&self) -> bool
Check if drain has been requested
§Panics
Panics if the internal mutex is poisoned (indicates a programming error).
Sourcepub fn drain_reason(&self) -> Option<String>
pub fn drain_reason(&self) -> Option<String>
Get the drain reason if set
§Panics
Panics if the internal mutex is poisoned (indicates a programming error).
Trait Implementations§
Source§impl Clone for RunControl
impl Clone for RunControl
Source§fn clone(&self) -> RunControl
fn clone(&self) -> RunControl
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RunControl
impl Debug for RunControl
Source§impl Default for RunControl
impl Default for RunControl
Source§fn default() -> RunControl
fn default() -> RunControl
Returns the “default value” for a type. Read more
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§
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