pub struct SampleFiles { /* private fields */ }Expand description
Sample file manager for test data.
Implementations§
Source§impl SampleFiles
impl SampleFiles
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new sample file manager.
Assumes samples are in crates/agtrace-providers/tests/samples/.
Sourcepub fn copy_to(&self, sample_name: &str, dest: &Path) -> Result<()>
pub fn copy_to(&self, sample_name: &str, dest: &Path) -> Result<()>
Copy a sample file to a destination.
Sourcepub fn copy_to_project(
&self,
sample_name: &str,
dest_name: &str,
project_dir: &str,
log_root: &Path,
) -> Result<()>
pub fn copy_to_project( &self, sample_name: &str, dest_name: &str, project_dir: &str, log_root: &Path, ) -> Result<()>
Copy a sample file to a Claude-encoded project directory.
Claude encodes project paths like: /Users/foo/bar -> -Users-foo-bar
Sourcepub fn copy_to_project_with_cwd(
&self,
sample_name: &str,
dest_name: &str,
target_project_dir: &str,
log_root: &Path,
provider_adapter: &ProviderAdapter,
) -> Result<()>
pub fn copy_to_project_with_cwd( &self, sample_name: &str, dest_name: &str, target_project_dir: &str, log_root: &Path, provider_adapter: &ProviderAdapter, ) -> Result<()>
Copy a sample file with cwd and sessionId replacement.
This creates isolated test sessions by:
- Replacing the embedded
cwdfield withtarget_project_dir(canonicalized) - Generating a unique
sessionIdbased on project dir + filename - Using provider-specific directory encoding via the provider adapter
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SampleFiles
impl RefUnwindSafe for SampleFiles
impl Send for SampleFiles
impl Sync for SampleFiles
impl Unpin for SampleFiles
impl UnwindSafe for SampleFiles
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