[−][src]Struct phar::Reader
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]
F: FnMut(&[u8], &mut dyn Read) -> Result<()>,
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]
&mut self,
f: F,
fold: G
) -> Result<Option<T>> where
F: FnMut(&[u8], &mut dyn Read) -> Result<U>,
G: FnMut(Option<T>, U) -> T,
Iterates over the files in this archive and fold return values.
Trait Implementations
Auto Trait Implementations
impl<R, FileIndexT> RefUnwindSafe for Reader<R, FileIndexT> where
FileIndexT: RefUnwindSafe,
R: RefUnwindSafe,
FileIndexT: RefUnwindSafe,
R: RefUnwindSafe,
impl<R, FileIndexT> Send for Reader<R, FileIndexT> where
FileIndexT: Send,
R: Send,
FileIndexT: Send,
R: Send,
impl<R, FileIndexT> Sync for Reader<R, FileIndexT> where
FileIndexT: Sync,
R: Sync,
FileIndexT: Sync,
R: Sync,
impl<R, FileIndexT> Unpin for Reader<R, FileIndexT> where
FileIndexT: Unpin,
R: Unpin,
FileIndexT: Unpin,
R: Unpin,
impl<R, FileIndexT> UnwindSafe for Reader<R, FileIndexT> where
FileIndexT: UnwindSafe,
R: UnwindSafe,
FileIndexT: UnwindSafe,
R: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,