| 366 | |
| 367 | #[pyfunction] |
| 368 | fn reader( |
| 369 | iter: PyIter, |
| 370 | options: FormatOptions, |
| 371 | // TODO: handle quote style, etc |
| 372 | _rest: FuncArgs, |
| 373 | vm: &VirtualMachine, |
| 374 | ) -> PyResult<Reader> { |
| 375 | Ok(Reader { |
| 376 | iter, |
| 377 | state: PyMutex::new(ReadState { |
| 378 | buffer: vec![0; 1024], |
| 379 | output_ends: vec![0; 16], |
| 380 | reader: options.to_reader(), |
| 381 | skipinitialspace: options.get_skipinitialspace(), |
| 382 | delimiter: options.get_delimiter(), |
| 383 | line_num: 0, |
| 384 | }), |
| 385 | dialect: options.result(vm)?, |
| 386 | }) |
| 387 | } |
| 388 | |
| 389 | #[pyfunction] |
| 390 | fn writer( |