pub trait StoreReader {
// Required methods
fn read_cargo_metadata(&mut self) -> Result<String, RecordReadError>;
fn read_test_list(&mut self) -> Result<TestListSummary, RecordReadError>;
fn read_record_opts(&mut self) -> Result<RecordOpts, RecordReadError>;
fn read_rerun_info(&mut self) -> Result<Option<RerunInfo>, RecordReadError>;
fn load_dictionaries(&mut self) -> Result<(), RecordReadError>;
fn read_output(
&mut self,
file_name: &str,
) -> Result<Vec<u8>, RecordReadError>;
fn extract_file_to_path(
&mut self,
store_path: &str,
output_path: &Utf8Path,
) -> Result<u64, RecordReadError>;
}Expand description
Trait for reading from a recorded run’s store.
This trait abstracts over reading from either an on-disk store directory
(via RecordReader) or from an inner store.zip within a portable archive
(via PortableStoreReader).
Required Methods§
Sourcefn read_cargo_metadata(&mut self) -> Result<String, RecordReadError>
fn read_cargo_metadata(&mut self) -> Result<String, RecordReadError>
Returns the cargo metadata JSON from the store.
Sourcefn read_test_list(&mut self) -> Result<TestListSummary, RecordReadError>
fn read_test_list(&mut self) -> Result<TestListSummary, RecordReadError>
Returns the test list summary from the store.
Sourcefn read_record_opts(&mut self) -> Result<RecordOpts, RecordReadError>
fn read_record_opts(&mut self) -> Result<RecordOpts, RecordReadError>
Returns the record options from the store.
Sourcefn read_rerun_info(&mut self) -> Result<Option<RerunInfo>, RecordReadError>
fn read_rerun_info(&mut self) -> Result<Option<RerunInfo>, RecordReadError>
Returns the rerun info from the store, if this is a rerun.
Returns Ok(None) if this run is not a rerun (the file doesn’t exist).
Sourcefn load_dictionaries(&mut self) -> Result<(), RecordReadError>
fn load_dictionaries(&mut self) -> Result<(), RecordReadError>
Loads the dictionaries from the store.
This must be called before reading output files.
Sourcefn read_output(&mut self, file_name: &str) -> Result<Vec<u8>, RecordReadError>
fn read_output(&mut self, file_name: &str) -> Result<Vec<u8>, RecordReadError>
Reads output for a specific file from the store.
The file_name should be the value from ZipStoreOutput::file_name,
e.g., “test-abc123-1-stdout”.
§Panics
Panics if load_dictionaries has not been called first.
Sourcefn extract_file_to_path(
&mut self,
store_path: &str,
output_path: &Utf8Path,
) -> Result<u64, RecordReadError>
fn extract_file_to_path( &mut self, store_path: &str, output_path: &Utf8Path, ) -> Result<u64, RecordReadError>
Extracts a file from the store to a path, streaming directly.
The store_path is relative to the store root (e.g., meta/test-list.json).
Returns the number of bytes written.