(tuple: &[PyObjectRef], vm: &VirtualMachine)
| 2524 | |
| 2525 | impl Address { |
| 2526 | fn from_tuple(tuple: &[PyObjectRef], vm: &VirtualMachine) -> PyResult<Self> { |
| 2527 | let host = PyStrRef::try_from_object(vm, tuple[0].clone())?; |
| 2528 | let host = host.try_into_utf8(vm)?; |
| 2529 | let port = i32::try_from_borrowed_object(vm, &tuple[1])?; |
| 2530 | let port = port |
| 2531 | .to_u16() |
| 2532 | .ok_or_else(|| vm.new_overflow_error("port must be 0-65535."))?; |
| 2533 | Ok(Self { host, port }) |
| 2534 | } |
| 2535 | |
| 2536 | fn from_tuple_ipv6( |
| 2537 | tuple: &[PyObjectRef], |
nothing calls this directly
no test coverage detected