Skip to content

little-arhat/rust-chainbuf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chainbuf

Build Status

Chained buffer of contigious byte chunks.

Simple usage

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);

Details of implementation

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).

About

port of chainbuf.h -- fast chained buffers

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages