2个版本
| 0.1.1 | 2022年4月26日 |
|---|---|
| 0.1.0 | 2022年4月25日 |
1125 in 数据结构
4KB
96 行
UPair.
此数据结构允许拥有无序对键,例如用于基于哈希的存储。
基本要求。
内部类型需要实现 Ord 特性。
let storage = HashSet::new();
storage.insert(UPair::new(1, 2));
assert!(storage.contains(UPair::new(2, 1));
实现特性。
- 如果内部类型实现了
Debug。 - 如果内部类型实现了
Copy。 - 如果内部类型实现了
Hash。 - 如果内部类型实现了
Eq, PartialEq。 Ord, PartialOrd.From<(T, T)>.From<[T; 2]>.IntoIterator.