MCPcopy Index your code
hub / github.com/RustPython/RustPython / from_tuple_ipv6

Method from_tuple_ipv6

crates/stdlib/src/socket.rs:2536–2555  ·  view source on GitHub ↗
(
            tuple: &[PyObjectRef],
            vm: &VirtualMachine,
        )

Source from the content-addressed store, hash-verified

2534 }
2535
2536 fn from_tuple_ipv6(
2537 tuple: &[PyObjectRef],
2538 vm: &VirtualMachine,
2539 ) -> PyResult<(Self, u32, u32)> {
2540 let addr = Self::from_tuple(tuple, vm)?;
2541 let flowinfo = tuple
2542 .get(2)
2543 .map(|obj| u32::try_from_borrowed_object(vm, obj))
2544 .transpose()?
2545 .unwrap_or(0);
2546 let scopeid = tuple
2547 .get(3)
2548 .map(|obj| u32::try_from_borrowed_object(vm, obj))
2549 .transpose()?
2550 .unwrap_or(0);
2551 if flowinfo > 0xfffff {
2552 return Err(vm.new_overflow_error("flowinfo must be 0-1048575."));
2553 }
2554 Ok((addr, flowinfo, scopeid))
2555 }
2556 }
2557
2558 fn get_ip_addr_tuple(addr: &SocketAddr, vm: &VirtualMachine) -> PyObjectRef {

Callers

nothing calls this directly

Calls 3

ErrClass · 0.50
mapMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected