| Crates.io | eureka-mmanager-core |
| lib.rs | eureka-mmanager-core |
| version | 0.1.5 |
| created_at | 2024-12-17 08:19:38.229099+00 |
| updated_at | 2025-09-05 06:01:02.861793+00 |
| description | The core package for the eureka-mmanager crate. |
| homepage | |
| repository | https://github.com/tonymushah/eureka-mmanager |
| max_upload_size | |
| id | 1485910 |
| size | 168,360 |
It's the core piece for eureka-mmanager and emdx crate.
Providing an ergonomic API to interact with the eureka-mmanager filesytem structure.
The DirsOption struct is the base of this entire repo. And you can only do two type of action with it:
use eureka_mmanager_core::{
data_pulls::{chapter::ChapterListDataPullFilterParams, IntoFiltered, Pull},
DirsOptions,
};
use mangadex_api_schema_rust::v5::ChapterObject;
use mangadex_api_types_rust::{Language, RelationshipType};
use uuid::Uuid;
fn main() -> anyhow::Result<()> {
// Making a `DirOptions` instance
let options = DirsOptions::new_from_data_dir("data");
// verify if the directories is present and create them if they not exits
options.verify_and_init()?;
// "Pull"ing a single chapter
if let Ok(chapter) = Pull::<ChapterObject, _>::pull(&options, Uuid::new_v4()) {
println!("{} exists", chapter.id);
}
// "Pull"ing all existing chapter
for chapter in options
.pull_all_chapter()?
.flatten()
/* you can also filter it */
.to_filtered(ChapterListDataPullFilterParams {
translated_languages: vec![Language::English],
..Default::default()
})
{
println!(
"got chapter {:?} - vol. {:?} from {:?}",
chapter.attributes.chapter,
chapter.attributes.volume,
chapter
.find_first_relationships(RelationshipType::Manga)
.map(|rel| { rel.id })
)
}
Ok(())
}