Struct epub::archive::EpubArchive
[−]
[src]
pub struct EpubArchive { pub path: String, pub files: Vec<String>, // some fields omitted }
Epub archive struct. Here it's stored the file path and the list of files in the zip archive.
Fields
path: String
files: Vec<String>
Methods
impl EpubArchive
[src]
fn new(path: &str) -> Result<EpubArchive, Box<Error>>
Opens the epub file in path
.
Errors
Returns an error if the zip is broken or if the file doesn't exists.
fn get_entry(&mut self, name: &str) -> Result<Vec<u8>, Box<Error>>
Returns the content of the file by the name
as Vec<u8>
.
Errors
Returns an error if the name doesn't exists in the zip archive.
fn get_entry_as_str(&mut self, name: &str) -> Result<String, Box<Error>>
Returns the content of the file by the name
as String
.
Errors
Returns an error if the name doesn't exists in the zip archive.
fn get_container_file(&mut self) -> Result<Vec<u8>, Box<Error>>
Returns the content of container file "META-INF/container.xml".
Errors
Returns an error if the epub doesn't have the container file.