While migrating c2patool to the unstable API, I ran across an issue where it's not possible to iterate unknown manifests and parse the format from a resource. Previously, Manifest::from_file_with_resources was used to extract resources, however, this has two downsides: (1) we have no control over how they are stored on the filesystem and (2) it only extracts known resources (with standardized labels, like thumbnails).
So, we introduce two new methods:
Added Reader::iter_manifests
Added Manifest::iter_resources
The first one allows us to iterate all manifests (even if we don't know the label) and the second one allows us to iterate all resources (including unknown ones) into a ResourceRef, which provides us with a mime type (format) and uri (identifier).
Checklist
[x] This PR represents a single feature, fix, or change.
[x] All applicable changes have been documented.
[x] Any TO DO items (or similar) have been entered as GitHub issues and the link to that issue has been included in a comment.
Changes in this pull request
While migrating
c2patool
to the unstable API, I ran across an issue where it's not possible to iterate unknown manifests and parse the format from a resource. Previously,Manifest::from_file_with_resources
was used to extract resources, however, this has two downsides: (1) we have no control over how they are stored on the filesystem and (2) it only extracts known resources (with standardized labels, like thumbnails).So, we introduce two new methods:
Reader::iter_manifests
Manifest::iter_resources
The first one allows us to iterate all manifests (even if we don't know the label) and the second one allows us to iterate all resources (including unknown ones) into a
ResourceRef
, which provides us with a mime type (format) and uri (identifier).Checklist
TO DO
items (or similar) have been entered as GitHub issues and the link to that issue has been included in a comment.