#stream #insert #read #write

insert_multiple

insert multiple items into a stream in reasonable runtime

3 unstable releases

Uses old Rust 2015

0.2.0 Nov 5, 2018
0.1.1 Nov 5, 2018
0.1.0 Nov 5, 2018

#1741 in Data structures

Download history 5/week @ 2024-02-19 19/week @ 2024-02-26 5/week @ 2024-03-11 48/week @ 2024-04-01

53 downloads per month

MIT license

11KB
227 lines

insert_multiple: insert multiple items into a stream

The scenario: you have an input stream, and you know you wish to insert a number of items into this stream at known offsets.

If your stream is a String or a Vec<u8> or similar, you shouldn't do this naively: performance is O(n**2), and you have to care about looping backwards through the input stream to preserve your offsets.

This crate supports this use case in O(n).

No runtime deps