singlemap

Crates.iosinglemap
lib.rssinglemap
version0.1.6
sourcesrc
created_at2022-01-24 02:03:17.362255
updated_at2022-06-08 04:37:20.821911
descriptionrust single map
homepage
repository
max_upload_size
id519955
size11,285
(450220020)

documentation

https://docs.rs/singlemap

README

singlemap

rust singlemap

更新 通过指针转换类型获得引用

#[macro_use]
extern crate singlemap;

#[test]
fn test_map(){
    single_push!("a",Box::new("aaaa".to_string()));
    let straa = single_get_unwrap!("a",Box<String>).clone();
    let refaa = single_get_ref!("a");
    println!("straa:{:?}",straa);
    println!("rustlaa:{:?}",refaa.cast_ref::<Box<String>>());
    single_get_ref_try!("a",Box<String>,|r:&Box<String>|{
        println!("single_get_try:{:?}",r);
    },{println!("error")});
}
Commit count: 0

cargo fmt