oeb-rs

Crates.iooeb-rs
lib.rsoeb-rs
version0.1.1
created_at2025-06-27 09:13:06.677407+00
updated_at2025-06-27 09:30:44.09378+00
descriptionoeb电子书解析库
homepage
repositoryhttps://github.com/michael-eddy/liboeb
max_upload_size
id1728358
size69,450
Ding (michael-eddy)

documentation

README

oeb-rs

how to use

    /* release oeb file */
    let mut instance = OebUnpack::new("test.oeb");
    if let Ok(assets) = instance.analysis() {
        assert!(assets.len() > 0);
        for asset in assets {
            //save assets file to local
            let path = instance.save_to(&asset.content_id, save_folder_path).unwrap();
            assert!(path.is_some());
        }
    } else {
        assert!(false);
    }
    instance.close();
    /* read oeb file */
    let mut instance = OebReader::new("test.oeb", temp_folder_path);
    instance.init();
    let chapters = instance.chapters();
    println!("chapters: {:?}", chapters);
    for (id, title) in chapters.unwrap_or_default() {
        let content = instance.get_chapter_content(&id);
        println!("title:{}, content: {}", title, content.unwrap());
    }
    //clear cache files
    instance.close();
Commit count: 0

cargo fmt