Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions hawkbit/src/ddi/deployment_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,14 @@ impl<'a> Chunk<'a> {
.map(move |a| Artifact::new(a, client.clone()))
}

/// An iterator on all the metadata of the chunk.
pub fn metadata(&self) -> impl Iterator<Item = (&str, &str)> {
self.chunk
.metadata
.iter()
.map(|a| (a.key.as_str(), a.value.as_str()))
}

/// Download all artifacts of the chunk to the directory defined in `dir`.
pub async fn download(&'a self, dir: &Path) -> Result<Vec<DownloadedArtifact>, Error> {
let mut dir = dir.to_path_buf();
Expand Down