This commit is contained in:
Dominik Werder
2021-05-07 08:25:13 +02:00
parent a89e1cfc50
commit db93ae1545
10 changed files with 70 additions and 65 deletions

View File

@@ -31,13 +31,11 @@ impl<T> InMemoryFrameAsyncReadStream<T>
where
T: AsyncRead + Unpin,
{
pub fn new(inp: T) -> Self {
// TODO make capacity adjustable.
let bufcap = 512;
pub fn new(inp: T, bufcap: usize) -> Self {
let mut t = Self {
inp,
buf: BytesMut::new(),
bufcap: bufcap,
bufcap,
wp: 0,
tryparse: false,
errored: false,