pub struct RunDirectory { /* private fields */ }Expand description
Manages the filesystem layout for a single pipeline run.
Implementations§
Source§impl RunDirectory
impl RunDirectory
Sourcepub fn create(base_dir: &Path, run_id: &str) -> Result<Self>
pub fn create(base_dir: &Path, run_id: &str) -> Result<Self>
Create a new run directory.
Creates the directory structure if it doesn’t exist.
Sourcepub fn checkpoint_path(&self) -> PathBuf
pub fn checkpoint_path(&self) -> PathBuf
Get the checkpoint file path.
Sourcepub fn manifest_path(&self) -> PathBuf
pub fn manifest_path(&self) -> PathBuf
Get the manifest file path.
Sourcepub fn node_dir(&self, node_id: &str) -> Result<PathBuf>
pub fn node_dir(&self, node_id: &str) -> Result<PathBuf>
Get the node directory path, creating it if needed.
Sourcepub fn write_prompt(&self, node_id: &str, prompt: &str) -> Result<()>
pub fn write_prompt(&self, node_id: &str, prompt: &str) -> Result<()>
Write the prompt for a node.
Sourcepub fn write_response(&self, node_id: &str, response: &str) -> Result<()>
pub fn write_response(&self, node_id: &str, response: &str) -> Result<()>
Write the response for a node.
Sourcepub fn write_manifest(&self, manifest: &RunManifest) -> Result<()>
pub fn write_manifest(&self, manifest: &RunManifest) -> Result<()>
Write the run manifest.
Sourcepub fn read_manifest(&self) -> Result<RunManifest>
pub fn read_manifest(&self) -> Result<RunManifest>
Read the run manifest.
Sourcepub fn write_artifact(&self, name: &str, content: &[u8]) -> Result<PathBuf>
pub fn write_artifact(&self, name: &str, content: &[u8]) -> Result<PathBuf>
Write an artifact file.
Sourcepub fn read_response(&self, node_id: &str) -> Result<String>
pub fn read_response(&self, node_id: &str) -> Result<String>
Read the response for a node.
Trait Implementations§
Source§impl Clone for RunDirectory
impl Clone for RunDirectory
Source§fn clone(&self) -> RunDirectory
fn clone(&self) -> RunDirectory
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 moreAuto Trait Implementations§
impl Freeze for RunDirectory
impl RefUnwindSafe for RunDirectory
impl Send for RunDirectory
impl Sync for RunDirectory
impl Unpin for RunDirectory
impl UnsafeUnpin for RunDirectory
impl UnwindSafe for RunDirectory
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more