Struct epub::archive::EpubArchive [−][src]
Epub archive struct. Here it's stored the file path and the list of files in the zip archive.
Fields
path: PathBuf
files: Vec<String>
Methods
impl EpubArchive
[src]
impl EpubArchive
pub fn new<P: AsRef<Path>>(path: P) -> Result<EpubArchive, Error>
[src]
pub fn new<P: AsRef<Path>>(path: P) -> Result<EpubArchive, Error>
Opens the epub file in path
.
Errors
Returns an error if the zip is broken or if the file doesn't exists.
pub fn get_entry<P: AsRef<Path>>(&mut self, name: P) -> Result<Vec<u8>, Error>
[src]
pub fn get_entry<P: AsRef<Path>>(&mut self, name: P) -> Result<Vec<u8>, 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.
pub fn get_entry_as_str<P: AsRef<Path>>(
&mut self,
name: P
) -> Result<String, Error>
[src]
pub fn get_entry_as_str<P: AsRef<Path>>(
&mut self,
name: P
) -> Result<String, 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.
pub fn get_container_file(&mut self) -> Result<Vec<u8>, Error>
[src]
pub fn get_container_file(&mut self) -> Result<Vec<u8>, Error>
Returns the content of container file "META-INF/container.xml".
Errors
Returns an error if the epub doesn't have the container file.
Auto Trait Implementations
impl Send for EpubArchive
impl Send for EpubArchive
impl Sync for EpubArchive
impl Sync for EpubArchive