6 个版本 (3 个破坏性更新)
0.4.1 | 2020 年 7 月 22 日 |
---|---|
0.4.0 | 2020 年 7 月 22 日 |
0.3.1 | 2020 年 7 月 22 日 |
0.2.0 | 2020 年 7 月 18 日 |
0.1.0 | 2020 年 7 月 18 日 |
#753 在 内存管理
14KB
284 行
ika
Rust 对象池
MIT
lib.rs
:
欢迎使用 ika 池
use ika::Pool;
fn main() {
let mut str_pool: Pool<String> = Pool::new(10);
str_pool.spawn_some(5)
.drain(..)
.enumerate()
.for_each(| (i, r) | {
r.push_str(&i.to_string());
r.push_str(" hallo");
});
let ok = str_pool.detach(2);
str_pool.attach(2, "wowo".to_owned());
}