diff --git a/box-format/src/file/reader.rs b/box-format/src/file/reader.rs index 71dc3cd..0dce582 100644 --- a/box-format/src/file/reader.rs +++ b/box-format/src/file/reader.rs @@ -166,6 +166,16 @@ impl BoxFileReader { .decompress_write(io::Cursor::new(mmap), dest) } + #[inline(always)] + pub fn find(&self, path: &BoxPath) -> Result<&Record, ExtractError> { + let record = self + .meta + .inode(path) + .and_then(|x| self.meta.record(x)) + .ok_or_else(|| ExtractError::NotFoundInArchive(path.to_path_buf()))?; + Ok(record) + } + #[inline(always)] pub fn extract>( &self,