pub struct MovableArchiveHandle { /* private fields */ }zip and blocking only.Expand description
An ArchiveHandle that owns its File.
Implementations§
Source§impl MovableArchiveHandle
impl MovableArchiveHandle
Sourcepub fn new(
owner: File,
dependent_builder: impl for<'_q> FnOnce(&'_q File) -> ArchiveHandle<'_q, File>,
) -> Self
pub fn new( owner: File, dependent_builder: impl for<'_q> FnOnce(&'_q File) -> ArchiveHandle<'_q, File>, ) -> 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 dependent_builder with a shared reference to the
owner that remains valid for the lifetime of the constructed struct.
Sourcepub fn try_new<Err>(
owner: File,
dependent_builder: impl for<'_q> FnOnce(&'_q File) -> Result<ArchiveHandle<'_q, File>, Err>,
) -> Result<Self, Err>
pub fn try_new<Err>( owner: File, dependent_builder: impl for<'_q> FnOnce(&'_q File) -> Result<ArchiveHandle<'_q, File>, Err>, ) -> Result<Self, Err>
Constructs a new self-referential struct or returns an error.
Consumes owner on error.
Sourcepub fn try_new_or_recover<Err>(
owner: File,
dependent_builder: impl for<'_q> FnOnce(&'_q File) -> Result<ArchiveHandle<'_q, File>, Err>,
) -> Result<Self, (File, Err)>
pub fn try_new_or_recover<Err>( owner: File, dependent_builder: impl for<'_q> FnOnce(&'_q File) -> Result<ArchiveHandle<'_q, File>, Err>, ) -> Result<Self, (File, 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 File
pub fn borrow_owner<'_q>(&'_q self) -> &'_q File
Borrows owner.
Sourcepub fn with_dependent<'outer_fn, Ret>(
&'outer_fn self,
func: impl for<'_q> FnOnce(&'_q File, &'outer_fn ArchiveHandle<'_q, File>) -> Ret,
) -> Ret
pub fn with_dependent<'outer_fn, Ret>( &'outer_fn self, func: impl for<'_q> FnOnce(&'_q File, &'outer_fn ArchiveHandle<'_q, File>) -> 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 File, &'outer_fn mut ArchiveHandle<'_q, File>) -> Ret,
) -> Ret
pub fn with_dependent_mut<'outer_fn, Ret>( &'outer_fn mut self, func: impl for<'_q> FnOnce(&'_q File, &'outer_fn mut ArchiveHandle<'_q, File>) -> Ret, ) -> Ret
Calls given closure func with an unique reference to dependent.
Sourcepub fn borrow_dependent<'_q>(&'_q self) -> &'_q ArchiveHandle<'_q, File>
pub fn borrow_dependent<'_q>(&'_q self) -> &'_q ArchiveHandle<'_q, File>
Borrows dependent.
Sourcepub fn into_owner(self) -> File
pub fn into_owner(self) -> File
Consumes self and returns the the owner.
Source§impl MovableArchiveHandle
impl MovableArchiveHandle
Sourcepub fn by_name(self, url: &ZipUrl) -> Result<MovableEntryHandle, UrlError>
pub fn by_name(self, url: &ZipUrl) -> Result<MovableEntryHandle, UrlError>
A version of ArchiveHandle::by_name that returns a MovableEntryHandle.