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

Function get_name

crates/stdlib/src/socket.rs:3153–3165  ·  view source on GitHub ↗
(luid: &NET_LUID_LH)

Source from the content-addressed store, hash-verified

3151 return Ok(list);
3152
3153 fn get_name(luid: &NET_LUID_LH) -> io::Result<widestring::WideCString> {
3154 let mut buf = [0; c::IF_NAMESIZE + 1];
3155 let ret = unsafe {
3156 IpHelper::ConvertInterfaceLuidToNameW(luid, buf.as_mut_ptr(), buf.len())
3157 };
3158 if ret == 0 {
3159 Ok(widestring::WideCString::from_ustr_truncate(
3160 widestring::WideStr::from_slice(&buf[..]),
3161 ))
3162 } else {
3163 Err(io::Error::from_raw_os_error(ret as i32))
3164 }
3165 }
3166 struct MibTable {
3167 ptr: core::ptr::NonNull<IpHelper::MIB_IF_TABLE2>,
3168 }

Callers 1

if_nameindexFunction · 0.70

Calls 3

as_mut_ptrMethod · 0.80
ErrClass · 0.50
lenMethod · 0.45

Tested by

no test coverage detected