[][src]Trait phar::read::index::FileIndex

pub trait FileIndex: Default {
    pub fn feed_entry(&mut self, offset: u64, entry: Entry) -> Result<()>;

    pub fn scan_files() -> bool { ... }
pub fn requires_name() -> bool { ... }
pub fn requires_metadata() -> bool { ... }
pub fn end_of_header(&mut self, _offset: u64) { ... } }
This is supported on crate feature reader only.

The storage used to store file indices.

If you open the phar only to view the stub, phar metadata, etc., use index::NoIndex.

To sequentially access all files in the archive, use index::Iterable implementations. If random file access is not required, use index::OffsetOnly.

To access specific files only, use index::RandomAccess implementations. Prefer using NameMap if individual entry metadata is not required. To also access their metadata, use MetadataMap. There are some type aliases for the respective HashMap/BTreeMap implementations.

Required methods

pub fn feed_entry(&mut self, offset: u64, entry: Entry) -> Result<()>[src]

Adds an Entry to the index.

Loading content...

Provided methods

pub fn scan_files() -> bool[src]

Whether file metadata should be scanned on loading.

pub fn requires_name() -> bool[src]

Whether Entry should force name to use Section::Cached.

pub fn requires_metadata() -> bool[src]

Whether Entry should force metadata to use Section::Cached.

pub fn end_of_header(&mut self, _offset: u64)[src]

Marks the end of header

Loading content...

Implementors

impl FileIndex for NoIndex[src]

impl FileIndex for OffsetOnly[src]

impl<M: Default + Extend<(Vec<u8>, (u32, Range<u64>))>> FileIndex for NameMap<M> where
    &'t M: IntoIterator<Item = (&'t Vec<u8>, &'t (u32, Range<u64>))>, 
[src]

impl<M: Default + Extend<(Vec<u8>, (Entry, Range<u64>))>> FileIndex for MetadataMap<M> where
    &'t M: IntoIterator<Item = (&'t Vec<u8>, &'t (Entry, Range<u64>))>, 
[src]

Loading content...