pub struct Archive<R: AsyncRead + AsyncSeek + Unpin> { /* private fields */ }Expand description
Implementations§
Source§impl<R: AsyncRead + AsyncSeek + Unpin> Archive<R>
impl<R: AsyncRead + AsyncSeek + Unpin> Archive<R>
Sourcepub fn reader_mut(&mut self) -> &mut R
pub fn reader_mut(&mut self) -> &mut R
Returns mutable reference to its inner reader.
It is mostly OK to seek the reader’s cursor, since every time accessing
its file will reset the cursor to the file’s position. However, write
access will compromise Archive’s functionality. Use with great care!
Sourcepub fn into_reader(self) -> R
pub fn into_reader(self) -> R
Drops the inner state and returns the reader.
Source§impl Archive<DuplicableFile>
impl Archive<DuplicableFile>
Source§impl<R: AsyncRead + AsyncSeek + Duplicable + Unpin> Archive<R>
impl<R: AsyncRead + AsyncSeek + Duplicable + Unpin> Archive<R>
Sourcepub async fn get_owned(&self, path: &str) -> Result<File<R>>
pub async fn get_owned(&self, path: &str) -> Result<File<R>>
Returns a file from the archive by duplicating the inner reader.
Contrary to Archive::get, it allows multiple read access over a single
archive by creating a new file handle for every file. Useful when building a
virtual file system like how Electron does.
Source§impl<R: AsyncRead + AsyncSeek + LocalDuplicable + Unpin> Archive<R>
impl<R: AsyncRead + AsyncSeek + LocalDuplicable + Unpin> Archive<R>
Sourcepub async fn get_owned_local(&self, path: &str) -> Result<File<R>>
pub async fn get_owned_local(&self, path: &str) -> Result<File<R>>
Returns a file from the archive by duplicating the inner reader, without Sync.
See Archive::get_owned for more information.
Trait Implementations§
Auto Trait Implementations§
impl<R> Freeze for Archive<R>where
R: Freeze,
impl<R> RefUnwindSafe for Archive<R>where
R: RefUnwindSafe,
impl<R> Send for Archive<R>where
R: Send,
impl<R> Sync for Archive<R>where
R: Sync,
impl<R> Unpin for Archive<R>
impl<R> UnwindSafe for Archive<R>where
R: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more