Reads a [`TarballEntry`] matching a specific path name from the package archive. Returns [`None`] if no [`TarballEntry`] is found in the package archive that matches `path`. # Errors Returns an error if - [`PackageReader::data_entries`] fails to retrieve the data entries, - or retrieving the details of a data entry fails.
(
&'a mut self,
path: P,
)
| 914 | /// - [`PackageReader::data_entries`] fails to retrieve the data entries, |
| 915 | /// - or retrieving the details of a data entry fails. |
| 916 | pub fn read_data_entry<'a, P: AsRef<Path>>( |
| 917 | &'a mut self, |
| 918 | path: P, |
| 919 | ) -> Result<Option<TarballEntry<'a, 'c>>, crate::Error> { |
| 920 | for entry in self.data_entries()? { |
| 921 | let entry = entry?; |
| 922 | if entry.path() == path.as_ref() { |
| 923 | return Ok(Some(entry)); |
| 924 | } |
| 925 | } |
| 926 | Ok(None) |
| 927 | } |
| 928 | } |
| 929 | |
| 930 | impl TryFrom<Package> for PackageReader<'_> { |