pub struct RunDir { /* private fields */ }Expand description
One run’s directory, <repo>/.onerig/runs/<run id>.
Implementations§
Source§impl RunDir
impl RunDir
pub fn create(repo: &Path, run_id: &str) -> Result<RunDir, StoreError>
pub fn open(repo: &Path, run_id: &str) -> Result<RunDir, StoreError>
pub fn path(&self) -> &Path
pub fn handover_path(&self, task_index: usize, attempt: u32) -> PathBuf
pub fn raw_log_path(&self, job_seq: u64) -> PathBuf
Sourcepub fn write_state(&self, state: &State) -> Result<(), StoreError>
pub fn write_state(&self, state: &State) -> Result<(), StoreError>
Replaces state.json atomically: a reader sees the old or the new file.
pub fn read_state(&self) -> Result<State, StoreError>
pub fn write_plan(&self, plan: &Plan) -> Result<(), StoreError>
pub fn read_plan(&self) -> Result<Plan, StoreError>
pub fn append_log(&self, record: &LogRecord) -> Result<(), StoreError>
pub fn read_log(&self) -> Result<Vec<LogRecord>, StoreError>
Trait Implementations§
impl Eq for RunDir
impl StructuralPartialEq for RunDir
Auto Trait Implementations§
impl Forget for RunDir
impl Freeze for RunDir
impl Move for RunDir
impl RefUnwindSafe for RunDir
impl Send for RunDirwhere
RawVecInner: Send,
impl Sync for RunDirwhere
RawVecInner: Sync,
impl Unpin for RunDir
impl UnsafeUnpin for RunDir
impl UnwindSafe for RunDirwhere
RawVecInner: 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