mirror of
git://git.proxmox.com/git/pxar.git
synced 2025-02-03 21:47:00 +03:00
accessor: add size method
to get the size the accessor was initially created with Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
a5922fbcdc
commit
a2530fb79c
@ -130,6 +130,10 @@ impl<T: ReadAt> AccessorImpl<T> {
|
||||
})
|
||||
}
|
||||
|
||||
pub fn size(&self) -> u64 {
|
||||
self.size
|
||||
}
|
||||
|
||||
pub async fn open_root_ref<'a>(&'a self) -> io::Result<DirectoryImpl<&'a dyn ReadAt>> {
|
||||
DirectoryImpl::open_at_end(
|
||||
&self.input as &dyn ReadAt,
|
||||
|
@ -94,6 +94,12 @@ impl<T: ReadAt> Accessor<T> {
|
||||
self.inner
|
||||
.set_goodbye_table_cache(cache.map(|cache| Arc::new(cache) as _))
|
||||
}
|
||||
|
||||
/// Get the full archive size we're allowed to access.
|
||||
#[inline]
|
||||
pub fn size(&self) -> u64 {
|
||||
self.inner.size()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Clone + ReadAt> Accessor<T> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user