(vm: &VirtualMachine, obj: &'a PyObject)
| 136 | struct Limits(libc::rlimit); |
| 137 | impl<'a> TryFromBorrowedObject<'a> for Limits { |
| 138 | fn try_from_borrowed_object(vm: &VirtualMachine, obj: &'a PyObject) -> PyResult<Self> { |
| 139 | let seq: Vec<libc::rlim_t> = obj.try_to_value(vm)?; |
| 140 | match *seq { |
| 141 | [cur, max] => Ok(Self(libc::rlimit { |
| 142 | rlim_cur: cur & RLIM_INFINITY, |
| 143 | rlim_max: max & RLIM_INFINITY, |
| 144 | })), |
| 145 | _ => Err(vm.new_value_error("expected a tuple of 2 integers")), |
| 146 | } |
| 147 | } |
| 148 | } |
| 149 | impl ToPyObject for Limits { |
| 150 | fn to_pyobject(self, vm: &VirtualMachine) -> PyObjectRef { |
nothing calls this directly
no test coverage detected