[][src]Struct phar::Reader

pub struct Reader<R: Read + Seek, FileIndexT: FileIndex = NameHashMap> { /* fields omitted */ }
This is supported on crate feature reader only.

The metadata of a phar file.

Implementations

impl<R: Read + Seek, FileIndexT: FileIndex> Reader<R, FileIndexT>[src]

pub fn read(read: R, options: Options) -> Result<Self>[src]

Parses the phar file.

This optionally validates the signature. Stub, metadata and file metadata are not fully validated, and may not be saved in memory depending on options.

pub fn stub_bytes(&mut self) -> Result<impl AsRef<[u8]> + '_>[src]

Returns the stub as a slice.

If the stub was previously not stored in memory, it is stored in a new Vec. Consider using stub_read() instead if cache_stub is false and storing the stub in memory is not intended.

pub fn stub_read(&mut self) -> Result<impl Read + '_>[src]

Returns the stub as an io::Read.

pub fn metadata_bytes(&mut self) -> Result<impl AsRef<[u8]> + '_>[src]

Returns the metadata as a slice.

If the metadata was previously not stored in memory, it is stored in a new Vec. Consider using metadata_read() instead if cache_metadata is false and storing the metadata in memory is not intended.

pub fn metadata_read(&mut self) -> Result<impl Read + '_>[src]

Returns the metadata as an io::Read.

impl<R: Read + Seek, FileIndexT: Iterable> Reader<R, FileIndexT>[src]

pub fn for_each_file<F>(&mut self, f: F) -> Result<()> where
    F: FnMut(&[u8], &mut dyn Read) -> Result<()>, 
[src]

Iterates over the files in this archive.

pub fn for_each_file_fold<F, G, T, U>(
    &mut self,
    f: F,
    fold: G
) -> Result<Option<T>> where
    F: FnMut(&[u8], &mut dyn Read) -> Result<U>,
    G: FnMut(Option<T>, U) -> T, 
[src]

Iterates over the files in this archive and fold return values.

Trait Implementations

impl<R: Debug + Read + Seek, FileIndexT: Debug + FileIndex> Debug for Reader<R, FileIndexT>[src]

Auto Trait Implementations

impl<R, FileIndexT> RefUnwindSafe for Reader<R, FileIndexT> where
    FileIndexT: RefUnwindSafe,
    R: RefUnwindSafe

impl<R, FileIndexT> Send for Reader<R, FileIndexT> where
    FileIndexT: Send,
    R: Send

impl<R, FileIndexT> Sync for Reader<R, FileIndexT> where
    FileIndexT: Sync,
    R: Sync

impl<R, FileIndexT> Unpin for Reader<R, FileIndexT> where
    FileIndexT: Unpin,
    R: Unpin

impl<R, FileIndexT> UnwindSafe for Reader<R, FileIndexT> where
    FileIndexT: UnwindSafe,
    R: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.