pub struct Handle { /* private fields */ }Expand description
Handle is a one-time token for inserting values into DeferredMap
Handle does not implement the Clone trait, ensuring it can only be used once through Rust’s move semantics.
Handle 是一次性令牌,用于向 DeferredMap 插入值
Handle 不实现 Clone trait,通过 Rust 的 move semantics 确保只能使用一次
§Examples (示例)
use deferred_map::DeferredMap;
let mut map = DeferredMap::new();
let handle = map.allocate_handle();
let key = map.insert(handle, 42).unwrap();
assert_eq!(map.get(key), Some(&42));Implementations§
Trait Implementations§
impl Eq for Handle
impl StructuralPartialEq for Handle
Auto Trait Implementations§
impl Freeze for Handle
impl RefUnwindSafe for Handle
impl Send for Handle
impl Sync for Handle
impl Unpin for Handle
impl UnwindSafe for Handle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more