(&self, length: OptionalArg<ArgSize>, vm: &VirtualMachine)
| 313 | |
| 314 | #[pymethod] |
| 315 | fn flush(&self, length: OptionalArg<ArgSize>, vm: &VirtualMachine) -> PyResult<Vec<u8>> { |
| 316 | let length = match length { |
| 317 | OptionalArg::Present(ArgSize { value }) if value <= 0 => { |
| 318 | return Err(vm.new_value_error("length must be greater than zero")); |
| 319 | } |
| 320 | OptionalArg::Present(ArgSize { value }) => value as usize, |
| 321 | OptionalArg::Missing => DEF_BUF_SIZE, |
| 322 | }; |
| 323 | |
| 324 | let inner = &mut *self.inner.lock(); |
| 325 | let data = core::mem::replace(&mut inner.unconsumed_tail, vm.ctx.empty_bytes.clone()); |
| 326 | |
| 327 | let (ret, _) = Self::decompress_inner(inner, &data, length, None, true, vm)?; |
| 328 | |
| 329 | if inner.eof { |
| 330 | inner.decompress = None; |
| 331 | } |
| 332 | |
| 333 | ret |
| 334 | } |
| 335 | } |
| 336 | |
| 337 | #[derive(FromArgs)] |
nothing calls this directly
no test coverage detected