Add StorageBackend::iter_files()
This commit is contained in:
parent
1b6711fe10
commit
d141a3670f
1 changed files with 11 additions and 0 deletions
|
@ -73,6 +73,17 @@ impl StorageBackend {
|
|||
}).ok()
|
||||
}
|
||||
|
||||
pub fn iter_files<'a, HP>(&self, m: &'a Module, p: &Parser<HP>)
|
||||
-> Option<IntoIter<File<'a>>>
|
||||
where HP: FileHeaderParser
|
||||
{
|
||||
self.iter_ids(m).and_then(|ids| {
|
||||
Some(ids.filter_map(|id| self.get_file_by_id(m, &id, p))
|
||||
.collect::<Vec<File>>()
|
||||
.into_iter())
|
||||
})
|
||||
}
|
||||
|
||||
/*
|
||||
* Write a file to disk.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue