pub struct AsyncMovableArchiveHandle { /* private fields */ }zip and async only.Expand description
An ArchiveHandle that owns its RandomAccessFile.
Implementations§
Source§impl AsyncMovableArchiveHandle
impl AsyncMovableArchiveHandle
Sourcepub async fn new(
owner: Arc<RandomAccessFile>,
dependent_builder: impl for<'_q> AsyncFnOnce(&'_q Arc<RandomAccessFile>) -> ArchiveHandle<'_q, Arc<RandomAccessFile>>,
) -> Self
pub async fn new( owner: Arc<RandomAccessFile>, dependent_builder: impl for<'_q> AsyncFnOnce(&'_q Arc<RandomAccessFile>) -> ArchiveHandle<'_q, Arc<RandomAccessFile>>, ) -> Self
Constructs a new self-referential struct.
The provided owner will be moved into a heap allocated box. Followed by construction
of the dependent value, by calling the async closure dependent_builder with a shared
reference to the owner that remains valid for the lifetime of the constructed struct.
Sourcepub async fn try_new<Err>(
owner: Arc<RandomAccessFile>,
dependent_builder: impl for<'_q> AsyncFnOnce(&'_q Arc<RandomAccessFile>) -> Result<ArchiveHandle<'_q, Arc<RandomAccessFile>>, Err>,
) -> Result<Self, Err>
pub async fn try_new<Err>( owner: Arc<RandomAccessFile>, dependent_builder: impl for<'_q> AsyncFnOnce(&'_q Arc<RandomAccessFile>) -> Result<ArchiveHandle<'_q, Arc<RandomAccessFile>>, Err>, ) -> Result<Self, Err>
Constructs a new self-referential struct or returns an error.
Consumes owner on error.
Sourcepub async fn try_new_or_recover<Err>(
owner: Arc<RandomAccessFile>,
dependent_builder: impl for<'_q> AsyncFnOnce(&'_q Arc<RandomAccessFile>) -> Result<ArchiveHandle<'_q, Arc<RandomAccessFile>>, Err>,
) -> Result<Self, (Arc<RandomAccessFile>, Err)>
pub async fn try_new_or_recover<Err>( owner: Arc<RandomAccessFile>, dependent_builder: impl for<'_q> AsyncFnOnce(&'_q Arc<RandomAccessFile>) -> Result<ArchiveHandle<'_q, Arc<RandomAccessFile>>, Err>, ) -> Result<Self, (Arc<RandomAccessFile>, Err)>
Constructs a new self-referential struct or returns an error.
Returns owner and error as tuple on error.
Sourcepub fn borrow_owner<'_q>(&'_q self) -> &'_q Arc<RandomAccessFile>
pub fn borrow_owner<'_q>(&'_q self) -> &'_q Arc<RandomAccessFile>
Borrows owner.
Sourcepub fn with_dependent<'outer_fn, Ret>(
&'outer_fn self,
func: impl for<'_q> FnOnce(&'_q Arc<RandomAccessFile>, &'outer_fn ArchiveHandle<'_q, Arc<RandomAccessFile>>) -> Ret,
) -> Ret
pub fn with_dependent<'outer_fn, Ret>( &'outer_fn self, func: impl for<'_q> FnOnce(&'_q Arc<RandomAccessFile>, &'outer_fn ArchiveHandle<'_q, Arc<RandomAccessFile>>) -> Ret, ) -> Ret
Calls given closure func with a shared reference to dependent.
Sourcepub fn with_dependent_mut<'outer_fn, Ret>(
&'outer_fn mut self,
func: impl for<'_q> FnOnce(&'_q Arc<RandomAccessFile>, &'outer_fn mut ArchiveHandle<'_q, Arc<RandomAccessFile>>) -> Ret,
) -> Ret
pub fn with_dependent_mut<'outer_fn, Ret>( &'outer_fn mut self, func: impl for<'_q> FnOnce(&'_q Arc<RandomAccessFile>, &'outer_fn mut ArchiveHandle<'_q, Arc<RandomAccessFile>>) -> Ret, ) -> Ret
Calls given closure func with an unique reference to dependent.
Sourcepub fn borrow_dependent<'_q>(
&'_q self,
) -> &'_q ArchiveHandle<'_q, Arc<RandomAccessFile>>
pub fn borrow_dependent<'_q>( &'_q self, ) -> &'_q ArchiveHandle<'_q, Arc<RandomAccessFile>>
Borrows dependent.
Sourcepub fn into_owner(self) -> Arc<RandomAccessFile>
pub fn into_owner(self) -> Arc<RandomAccessFile>
Consumes self and returns the the owner.
Source§impl AsyncMovableArchiveHandle
impl AsyncMovableArchiveHandle
Sourcepub async fn new_for(
file: Arc<RandomAccessFile>,
) -> Result<AsyncMovableArchiveHandle, UrlError>
pub async fn new_for( file: Arc<RandomAccessFile>, ) -> Result<AsyncMovableArchiveHandle, UrlError>
Constructor.
Source§impl AsyncMovableArchiveHandle
impl AsyncMovableArchiveHandle
Sourcepub async fn by_name(
self,
url: &ZipUrl,
) -> Result<AsyncMovableEntryHandle, UrlError>
pub async fn by_name( self, url: &ZipUrl, ) -> Result<AsyncMovableEntryHandle, UrlError>
A version of ArchiveHandle::by_name that returns a AsyncMovableEntryHandle.