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

Function gethostbyname

crates/stdlib/src/socket.rs:2936–2942  ·  view source on GitHub ↗
(name: PyUtf8StrRef, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

2934
2935 #[pyfunction]
2936 fn gethostbyname(name: PyUtf8StrRef, vm: &VirtualMachine) -> Result<String, IoOrPyException> {
2937 let addr = get_addr(vm, name, c::AF_INET)?;
2938 match addr {
2939 SocketAddr::V4(ip) => Ok(ip.ip().to_string()),
2940 _ => unreachable!(),
2941 }
2942 }
2943
2944 #[pyfunction]
2945 fn gethostbyname_ex(

Callers

nothing calls this directly

Calls 3

get_addrFunction · 0.85
to_stringMethod · 0.80
ipMethod · 0.45

Tested by

no test coverage detected