{"id":16064403,"url":"https://github.com/finnbear/maybe_parallel_iterator","last_synced_at":"2025-03-18T05:30:41.599Z","repository":{"id":40613994,"uuid":"496832834","full_name":"finnbear/maybe_parallel_iterator","owner":"finnbear","description":"Toggle parallelism with feature flags!","archived":false,"fork":false,"pushed_at":"2022-06-27T02:47:48.000Z","size":17,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-16T17:12:50.632Z","etag":null,"topics":["crate","parallel","parallelism","rayon","rust","rust-crate","rust-lang"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/maybe_parallel_iterator","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/finnbear.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-05-27T02:10:36.000Z","updated_at":"2022-05-30T23:58:22.000Z","dependencies_parsed_at":"2022-08-26T23:22:09.898Z","dependency_job_id":null,"html_url":"https://github.com/finnbear/maybe_parallel_iterator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finnbear%2Fmaybe_parallel_iterator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finnbear%2Fmaybe_parallel_iterator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finnbear%2Fmaybe_parallel_iterator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finnbear%2Fmaybe_parallel_iterator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/finnbear","download_url":"https://codeload.github.com/finnbear/maybe_parallel_iterator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244164604,"owners_count":20408960,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crate","parallel","parallelism","rayon","rust","rust-crate","rust-lang"],"created_at":"2024-10-09T05:07:10.319Z","updated_at":"2025-03-18T05:30:40.496Z","avatar_url":"https://github.com/finnbear.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# maybe_parallel_iterator\n\nWrite your code once. Then toggle between sequential and parallel iterators with a feature flag!\n\n```rust\nlet a: Vec\u003ci32\u003e = (0..100).collect();\na.into_maybe_parallel_iterator()\n    .with_min_sequential(2)\n    .map(|n| -n)\n    .enumerate()\n    .flat_map(|(e, n)| vec![e as i32, n, n + 1000].into_maybe_parallel_iterator())\n    .for_each(|item| {\n        println!(\"par: {:?}\", item);\n    })\n```\n\n## Features\n\n- Iterators\n  - `into_maybe_par_iter`\n  - `maybe_par_iter`\n  - `maybe_par_iter_mut`\n- Sorts\n  - `maybe_par_sort`\n  - `maybe_par_sort_unstable`\n  - `maybe_par_sort_by`\n  - `maybe_par_sort_unstable_by`\n  - `maybe_par_sort_by_key`\n  - `maybe_par_sort_unstable_by_key`\n\nUse the `rayon` feature flag to enable [rayon](https://github.com/rayon-rs/rayon) parallelism.\n\nThe default is sequential (\"rayoff\" mode).\n\n## Limitations\n\nFor now, only supports these iterator adapters:\n\n- `collect`\n- *`enumerate`\n- `filter_map`\n- `find_any`\n- `flat_map`\n- `for_each`\n- `map`\n- *`with_min_sequential` (no-op unless `rayon` feature enabled)\n\n*Only available for `IndexedParallelIterator`'s if `rayon` feature enabled.\n\n## License\n\nLicensed under either of\n\n* Apache License, Version 2.0\n  ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n* MIT license\n  ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n## Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffinnbear%2Fmaybe_parallel_iterator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffinnbear%2Fmaybe_parallel_iterator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffinnbear%2Fmaybe_parallel_iterator/lists"}