本文简要介绍rust语言中 alloc::collections::btree_map::VacantEntry.into_key
的用法。
用法
pub fn into_key(self) -> K
取得 key 的所有权。
例子
use std::collections::BTreeMap;
use std::collections::btree_map::Entry;
let mut map: BTreeMap<&str, usize> = BTreeMap::new();
if let Entry::Vacant(v) = map.entry("poneyland") {
v.into_key();
}
相关用法
- Rust VacantEntry.into_key用法及代码示例
- Rust VacantEntry.insert用法及代码示例
- Rust VacantEntry.key用法及代码示例
- Rust Values用法及代码示例
- Rust ValuesMut用法及代码示例
- Rust VecDeque.binary_search_by_key用法及代码示例
- Rust VecDeque.rotate_left用法及代码示例
- Rust VecDeque.remove用法及代码示例
- Rust VecDeque.swap_remove_back用法及代码示例
- Rust Vec.drain用法及代码示例
- Rust Vec.into_raw_parts用法及代码示例
- Rust VecDeque.contains用法及代码示例
- Rust VecDeque.iter用法及代码示例
- Rust VecDeque.split_off用法及代码示例
- Rust Vec.resize用法及代码示例
- Rust VecDeque.reserve_exact用法及代码示例
- Rust VecDeque.capacity用法及代码示例
- Rust VecDeque.is_empty用法及代码示例
- Rust Vec.swap_remove用法及代码示例
- Rust VecDeque.resize用法及代码示例
- Rust VecDeque.back用法及代码示例
- Rust VecDeque.new用法及代码示例
- Rust VecDeque.resize_with用法及代码示例
- Rust Vec.is_empty用法及代码示例
- Rust VecDeque.as_mut_slices用法及代码示例
注:本文由纯净天空筛选整理自rust-lang.org大神的英文原创作品 alloc::collections::btree_map::VacantEntry.into_key。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。