当我对 Google.com 进行简单的域名 whois 查找时,我得到以下结果:
[...]
Registrant Organization: Google LLC
Registrant State/Province: CA
Registrant Country: US
Registrant Email: Select Request Email Form at https://domains.markmonitor.com/whois/google.com
Admin Organization: Google LLC
Admin State/Province: CA
Admin Country: US
Admin Email: Select Request Email Form at https://domains.markmonitor.com/whois/google.com
Tech Organization: Google LLC
Tech State/Province: CA
Tech Country: US
[...]
Run Code Online (Sandbox Code Playgroud)
但是当我使用 rdap 时,例如使用以下网站:
https://client.rdap.org/?type=domain&object=google.com
Run Code Online (Sandbox Code Playgroud)
生成的 json 不包含任何指向 Google LLC 的数据。这是因为我以错误的方式使用 rdap 还是因为 Google 的 rdap 条目根本不包含注册人/管理员/技术组织数据?
考虑以下代码(最小示例):
use std::collections::HashMap;
fn main() {
let mut map: HashMap<usize, i128> = HashMap::new();
map.insert(1, -5);
map.insert(2, 6);
map.insert(3, 7);
for i in map.keys() {
if *i == 3 {
continue;
}
*map.get_mut(&3).unwrap() += map[i];
}
}
Run Code Online (Sandbox Code Playgroud)
借阅检查员会抱怨:
use std::collections::HashMap;
fn main() {
let mut map: HashMap<usize, i128> = HashMap::new();
map.insert(1, -5);
map.insert(2, 6);
map.insert(3, 7);
for i in map.keys() {
if *i == 3 {
continue;
}
*map.get_mut(&3).unwrap() += map[i];
}
}
Run Code Online (Sandbox Code Playgroud)
但是,在这种情况下,我可以确定我所做的更改不会干扰不可变引用。For Vec,我会split_at_mut在这里使用-HashMap在 Rust …