| Crates.io | async-iter-ext |
| lib.rs | async-iter-ext |
| version | 0.3.0 |
| created_at | 2025-06-24 19:50:02.884793+00 |
| updated_at | 2025-07-16 18:52:06.233546+00 |
| description | Async iterator methods and async methods for option and result. |
| homepage | |
| repository | https://github.com/csandven/async-iter-ext |
| max_upload_size | |
| id | 1724925 |
| size | 90,092 |
Async iterator methods and async methods for option and result.
[dependencies]
async-iter-ext = "0.3.0"
use async_iter_ext::AsyncIterTools;
use async_iter_ext::{AsyncIterTools, AsyncIterator};
use async_std::task::sleep;
use std::time::Duration;
#[async_std::main]
async fn main() {
let items = [1, 2, 3, 4];
let mapped_items_vec = items
.iter()
.map_async(|item| async move {
sleep(Duration::from_millis(100)).await;
item * 2
})
.async_collect::<Vec<_>>()
.await;
assert_eq!(mapped_items_vec.len(), items.len());
assert_eq!(mapped_items_vec, vec![2, 4, 6, 8]);
}
Dual-licensed to be compatible with the Rust project.
Licensed under the Apache License, Version 2.0 https://www.apache.org/licenses/LICENSE-2.0 or the MIT license https://opensource.org/licenses/MIT, at your option. This file may not be copied, modified, or distributed except according to those terms.