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
FrameDecoder frame_decoder.total_in(): returns the number of compressed bytes which have entered the decompressor so far
FrameDecoder frame_decoder.total_out(): returns the number of decompressed bytes outputed by the compressor so far
These values appear to be stored easily as private variables in the FrameDecoder struct. It would be awesome if they were accessible.
Reasoning
The comparable XzDecoder in the xz2 library has this exact setup.
It would make creating progress report messages very straight-forward.
Other Notes
Perhaps creating a TotalInOut trait for this would be cool?
Ideally, ensure that reading these values does not require a mutable reference to the FrameDecoder. Seems obvious, but getting the current seek location in a File requires a mutable reference, so I guess it's not as obvious as you'd think.
The text was updated successfully, but these errors were encountered:
In your opinion, should I create a trait for this, or just implement the functions? I'm pretty new to Rust, and don't have a great grasp on effective library design yet. I'll work on implementing this.
Re seek (which isn't relevent here) - file_reader.stream_position() requires a mutable reference because it calls self.seek(SeekFrom::Current(0)) under the hood. This call does not actually seek (i.e., it does not move the read "pointer"). It frustrates me.
Feature request: add the following methods:
FrameDecoder frame_decoder.total_in()
: returns the number of compressed bytes which have entered the decompressor so farFrameDecoder frame_decoder.total_out()
: returns the number of decompressed bytes outputed by the compressor so farThese values appear to be stored easily as private variables in the
FrameDecoder
struct. It would be awesome if they were accessible.Reasoning
XzDecoder
in the xz2 library has this exact setup.Other Notes
TotalInOut
trait for this would be cool?FrameDecoder
. Seems obvious, but getting the current seek location in aFile
requires a mutable reference, so I guess it's not as obvious as you'd think.The text was updated successfully, but these errors were encountered: