Crates.io | chainbuf |
lib.rs | chainbuf |
version | 0.1.0 |
source | src |
created_at | 2015-10-24 20:17:29.166637 |
updated_at | 2021-05-24 11:09:59.251224 |
description | Fast chained buffers |
homepage | |
repository | https://github.com/little-arhat/rust-chainbuf |
max_upload_size | |
id | 3296 |
size | 62,279 |
Chained buffer of contigious byte chunks.
Plug the package into your app via Cargo:
[dependencies]
chainbuf = "0.0.4"
then use it:
extern crate chainbuf;
use chainbuf::Chain;
let mut chain = Chain::new();
chain.append_bytes("helloworld".as_bytes());
let some_bytes = chain.pullup(2);
Chainbuf consists of linked list of nodes, with start
and end
offsets and a reference counted pointer to DataHolder. DataHolders can be
shared across different chains, so for mutation new nodes and data holders
are created (as in Copy-On-Write).