This repository has been archived by the owner on Aug 23, 2022. It is now read-only.
Stream::read: partial read OR returning the expected size of the buffer #28
Labels
enhancement
New feature or request
The problem I'm facing right now is where I'm passing a buffer to
Stream::read
, which is not big enough (Error::ErrShortBuffer
). Note there's no indication of the expected size => you're forced to guess the number.Also note it's different from
TcpStream
https://doc.rust-lang.org/std/io/trait.Read.html#tymethod.read, which partially reads the data and does not put any restrictions on the size of the buffer (i.e. you, the caller, is in control of how fast you're consuming data).I can see that the code in Pion is identical to one here, but I nonetheless think we need to change something.
Either
ErrShortBuffer
to beErrShortBuffer { min: usize }
Comments and suggestions are welcome.
The text was updated successfully, but these errors were encountered: