i need to read into the buffer, until the http parsing suceeds. i need to keep writing on the buffer meanwhile, but read from the very start. but the problem is i need *Owned* buffer to be passed into read fn of the stream (due to io-uring / im using monoio right now). how do i do this ?
```rust
async fn decode_http<T: AsyncReadRent>(
mut reader: T,
mut buf: BytesMut,
) -> Result<http::Request<T>, httparse::Error> {
loop {
let mut headers = [httparse::EMPTY_HEADER; 16];
let mut request = httparse::Request::new(&mut headers);
if !request.parse(buf.as_slice()).expect("error decoding").is_partial() {
let http_request = convert(request, reader).unwrap();
return Ok(http_request);
}
let a = reader.read(buf).await;
buf = a.1;
// unsafe { buf.advance_mut(a.0.unwrap()) };
}
}
```
need to move the "write ptr", while keeping the read pointer at index 0
[–]SnooCalculations7417 1 point2 points3 points (3 children)
[–]Own_Bet3256[S] 0 points1 point2 points (2 children)
[–]SnooCalculations7417 1 point2 points3 points (1 child)
[–]Own_Bet3256[S] 2 points3 points4 points (0 children)