-
-
Save rust-play/26c34df4f98d5ce6b34e050763092215 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`use dashmap::DashMap; | |
use std::sync::{Mutex, Arc}; | |
struct Model { | |
pub value: String, | |
} | |
fn main() { | |
let map: Arc<DashMap<String, Model>> = Arc::new(DashMap::new()); | |
map.insert(String::from("1"), Model {value: String::from("A")}); | |
let mut entry1 = map.get_mut("1").unwrap(); | |
println!("HAS MUT"); | |
let contains = map.contains_key("1"); | |
println!("AFTER"); | |
}` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment