| Crates.io | domi |
| lib.rs | domi |
| version | 0.1.0-alpha.22 |
| created_at | 2025-12-22 12:38:15.621392+00 |
| updated_at | 2026-01-24 18:57:36.760778+00 |
| description | domi provides abstractions and utilities for domain-list-community data source. |
| homepage | |
| repository | https://github.com/chise0713/domi |
| max_upload_size | |
| id | 1999648 |
| size | 77,196 |
domi provides abstractions and utilities for domain-list-community data source.
use std::{fs, path::Path};
use domi::{srs::Rule, Entries};
const BASE: &str = "alphabet";
fn main() {
let data_root = Path::new("data");
let content = fs::read_to_string(data_root.join(BASE)).unwrap();
let mut entries = Entries::parse(BASE, content.lines());
while let Some(i) = entries.next_include() {
let include = fs::read_to_string(data_root.join(i.as_ref())).unwrap();
entries.parse_extend(BASE, include.lines());
}
// expect: domain_keyword: Some(["fitbit", "google"])
// change the `Some(&[])` to something else can alter behavier,
// see crate::Entries
println!("{:?}", Rule::from(entries.flatten(BASE, Some(&[])).unwrap()))
}
find more examples at examples/
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.