Currently read and write operations in traits require an extra level of
buffering. Alternative methods for direct reading/writing could be required,
but this has some caveats: the writer must know in advance exactly how much
data will be written and must read exactly the amount of data given, failing if
data cannot be read.
A compromise would be to allow the user to choose which to implement. But this
would require a switch describing which methods should be used, which is where
associated constants come in (Rust issue #29646).
Currently read and write operations in traits require an extra level of buffering. Alternative methods for direct reading/writing could be required, but this has some caveats: the writer must know in advance exactly how much data will be written and must read exactly the amount of data given, failing if data cannot be read.
A compromise would be to allow the user to choose which to implement. But this would require a switch describing which methods should be used, which is where associated constants come in (Rust issue #29646).
Traits this is applicable to:
#0025