Add getters to zlib.Decompressor

This commit is contained in:
Noah
2020-05-01 14:14:51 -05:00
parent aafbdd06b2
commit 130840c91c

View File

@@ -150,6 +150,19 @@ impl PyValue for PyDecompress {
}
#[pyimpl]
impl PyDecompress {
#[pyproperty]
fn eof(&self) -> bool {
self.eof.load()
}
#[pyproperty]
fn unused_data(&self) -> PyBytesRef {
self.unused_data.lock().unwrap().clone()
}
#[pyproperty]
fn unconsumed_tail(&self) -> PyBytesRef {
self.unconsumed_tail.lock().unwrap().clone()
}
fn save_unconsumed_input(
&self,
d: &mut Decompress,