Skip to content

Commit

Permalink
feat: add file with default metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
grumbach committed Oct 17, 2024
1 parent 4e14c66 commit 59de2dd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions autonomi/src/client/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ impl Archive {
self.map.insert(path, (data_addr, meta));
}

/// Add a file to a local archive, with default metadata
/// Note that this does not upload the archive to the network
pub fn add_new_file(&mut self, path: PathBuf, data_addr: DataAddr) {
self.map.insert(path, (data_addr, Metadata::new()));
}

/// List all files in the archive
pub fn files(&self) -> Vec<(PathBuf, Metadata)> {
self.map
Expand Down

0 comments on commit 59de2dd

Please sign in to comment.