[−][src]Crate byte_pool
Pool of byte slices.
Example
use byte_pool::BytePool; // Create a pool let pool = BytePool::new(); // Allocate a buffer let mut buf = pool.alloc(1024); // write some data into it for i in 0..100 { buf[i] = 12; } // Check that we actually wrote sth. assert_eq!(buf[55], 12); // Returns the underlying memory to the pool. drop(buf); // Frees all memory in the pool. drop(pool);
Structs
| Block | |
| BytePool | A pool of byte slices, that reuses memory. |
| RawBlock |