pub struct ZipIndex<R: Read + Seek> { /* private fields */ }Expand description
Read Python resources from a zip file.
Instances are bound to a handle on a zip archive. At open time, the zip archive index is read and an index of files within is constructed. File content is resolved when individual members are accessed.
Implementations§
Source§impl<R: Read + Seek> ZipIndex<R>
impl<R: Read + Seek> ZipIndex<R>
Sourcepub fn new(reader: R, prefix: Option<&Path>) -> Result<Self>
pub fn new(reader: R, prefix: Option<&Path>) -> Result<Self>
Construct a new instance from a reader of zip data and an optional path prefix.
The path prefix denotes the path within the zip file to look for content. All paths outside this prefix are ignored.
Sourcepub fn find_python_module(&mut self, full_name: &str) -> Option<ZipPythonModule>
pub fn find_python_module(&mut self, full_name: &str) -> Option<ZipPythonModule>
Attempt to locate a Python module within the zip archive.
full_name is the fully qualified / dotted Python module name.
Auto Trait Implementations§
impl<R> Freeze for ZipIndex<R>where
R: Freeze,
impl<R> RefUnwindSafe for ZipIndex<R>where
R: RefUnwindSafe,
impl<R> Send for ZipIndex<R>where
R: Send,
impl<R> Sync for ZipIndex<R>where
R: Sync,
impl<R> Unpin for ZipIndex<R>where
R: Unpin,
impl<R> UnwindSafe for ZipIndex<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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more