You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, creating AuReader with AuReader::new() requires the inner reader to implement std::io::Read and std::io::Seek.AuReader needs to be changed to support inner readers implementing std::io::Read only. However, it should also keep the current functionality for inner readers implementing std::io::Seek.
Therefore, this change seems to require some kind of specialization. The AuReader::new() function should behave slightly differently depending on the inner reader:
if the inner reader implements std::io::Read only, then initial_stream_len should be set to None.
if the inner reader implements std::io::Read and std::io::Seek, then initial_stream_len should be set to Some(stream_length).
There's private AuReader::new_read() as an example how the new() function would look like for inner readers implementing only std::io::Read, but it can't be used, because calling it for inner readers implementing std::io::Seek would give wrong results (initial_stream_len would be set to None instead of Some(..)).
The text was updated successfully, but these errors were encountered:
Currently, creating
AuReader
withAuReader::new()
requires the inner reader to implementstd::io::Read
andstd::io::Seek
.AuReader
needs to be changed to support inner readers implementingstd::io::Read
only. However, it should also keep the current functionality for inner readers implementingstd::io::Seek
.Therefore, this change seems to require some kind of specialization. The
AuReader::new()
function should behave slightly differently depending on the inner reader:std::io::Read
only, theninitial_stream_len
should be set toNone
.std::io::Read
andstd::io::Seek
, theninitial_stream_len
should be set toSome(stream_length)
.Rust doesn't seem to support specialization at the moment, so it isn't possible to have two different behaviors for
new()
.There's private
AuReader::new_read()
as an example how thenew()
function would look like for inner readers implementing onlystd::io::Read
, but it can't be used, because calling it for inner readers implementingstd::io::Seek
would give wrong results (initial_stream_len
would be set toNone
instead ofSome(..)
).The text was updated successfully, but these errors were encountered: