swimmer

Crates.ioswimmer
lib.rsswimmer
version0.3.0
sourcesrc
created_at2019-08-17 23:09:43.212534
updated_at2021-02-16 02:31:50.678695
descriptionThread-safe object pool type
homepage
repositoryhttps://github.com/caelunshun/swimmer-rs
max_upload_size
id157712
size37,876
(caelunshun)

documentation

README

swimmer

Thread-safe object pools for Rust.

use swimmer::Pool;

let pool: Pool<String> = Pool::with_size(10);
assert_eq!(pool.size(), 10);

let value = pool.get()
assert_eq!(pool.size(), 9);
assert_eq!(*value, "");

drop(value);
// Value is returned to pool
assert_eq!(pool.size(), 10);

See the documentation for more.

Commit count: 12

cargo fmt