[−][src]Struct zim::Zim
Represents a ZIM file
Fields
header: ZimHeader
master_view: Mmap
file_path: PathBuf
The path to the file.
mime_table: Vec<String>
List of mimetypes used in this ZIM archive
url_list: Vec<u64>
article_list: Vec<u32>
cluster_list: Vec<u64>
checksum: GenericArray<u8, <Md5 as Digest>::OutputSize>
MD5 checksum.
Methods
impl Zim
[src]
pub fn new<P: AsRef<Path>>(p: P) -> Result<Zim, Error>
[src]
Loads a Zim file
Loads a Zim file and parses the header, and the url, title, and cluster offset tables. The rest of the data isn't parsed until it's needed, so this should be fairly quick.
pub fn article_count(&self) -> usize
[src]
Get the number of articles.
pub fn verify_checksum(&self) -> Result<(), Error>
[src]
Computes the checksum, and returns an error if it does not match the one in the file.
pub fn get_mimetype(&self, id: u16) -> Option<MimeType>
[src]
Indexes into the ZIM mime_table.
pub fn iterate_by_urls(&self) -> DirectoryIterator
[src]
Iterates over articles, sorted by URL.
For performance reasons, you might want to extract by cluster instead.
pub fn get_by_url_index(&self, idx: u32) -> Result<DirectoryEntry, Error>
[src]
Returns the DirectoryEntry
for the article found at the given URL index.
idx must be between 0 and article_count
pub fn get_cluster(&self, idx: u32) -> Result<Cluster, Error>
[src]
Returns the given Cluster
idx must be between 0 and cluster_count
Auto Trait Implementations
impl RefUnwindSafe for Zim
impl Send for Zim
impl Sync for Zim
impl Unpin for Zim
impl UnwindSafe for Zim
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,
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.
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>,