crates-url codecov pipeline status

Kitty Pool

Ready For Production

The short answer is NO. This crate is not ready for production use. This is my first crate and frankly the crate will change after async makes it into stable.

A number of open tasks exist for the crate: - [ ] Is the API stable? - [ ] Is the crate performant enough? - [ ] Are there good examples? - [ ] Is there good documentation? - [ ] How does the crate interact with other useful libraries? I.E. can this crate effectively act as a single buffer for existing crates to avoid copies?

Purpose

The goal of this crate is to provide a safe and easy to use buffer pool in both a single-threaded and multi-threaded environment. The 'Kitty Pool' allows for requesting of 'Ranges', which act as owned slices into the buffer. The user of the 'Ranges' can then safely read and write to the owned parts of the buffer.

Example

```rust use kitty_pool::*;

const POOLSIZE: usize = 1024; const BLOCKSIZE: usize = 64; const REQUEST_SIZE: usize = 256;

fn main() { let mut kittypool = KittyPool::new(POOLSIZE, BLOCKSIZE); let randstring: String = threadrng() .sampleiter(&Alphanumeric) .take(REQUESTSIZE) .collect(); let randbytes: Vec = Vec::from(randstring.asbytes()); let mut buffer = vec![0; REQUESTSIZE]; let future = async { let mut token = kittypool.borrow(REQUESTSIZE).await; assert!(token.isok()); token = kittypool.write(&token.unwrap(), &randbytes).await; assert!(token.isok()); token = kittypool.read(&token.unwrap(), &mut buffer).await; assert!(token.isok()); asserteq!(*buffer, *randbytes); assert!(kittypool.release(&token.unwrap()).isok()); }; blockon(future); } ```

TODO