(encoding: PyUtf8StrRef, vm: &VirtualMachine)
| 29 | |
| 30 | #[pyfunction] |
| 31 | fn lookup(encoding: PyUtf8StrRef, vm: &VirtualMachine) -> PyResult { |
| 32 | if encoding.as_str().contains('\0') { |
| 33 | return Err(cstring_error(vm)); |
| 34 | } |
| 35 | vm.state |
| 36 | .codec_registry |
| 37 | .lookup(encoding.as_str(), vm) |
| 38 | .map(|codec| codec.into_tuple().into()) |
| 39 | } |
| 40 | |
| 41 | #[derive(FromArgs)] |
| 42 | struct CodeArgs { |
no test coverage detected