MCPcopy Create free account
hub / github.com/cosdata/cosdata / to_list

Method to_list

src/models/common.rs:692–706  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

690 }
691
692 pub fn to_list(&self) -> Vec<(K, V)>
693 where
694 K: Clone,
695 V: Clone,
696 {
697 self.hash_table_list
698 .iter()
699 .flat_map(|ht| {
700 let ht = ht.lock().unwrap();
701 ht.iter()
702 .map(|(k, v)| (k.clone(), v.clone()))
703 .collect::<Vec<_>>()
704 })
705 .collect()
706 }
707
708 pub fn from_list(size: u8, kv: Vec<(K, V)>) -> Self {
709 let tsh = Self::new(size);

Calls 2

cloneMethod · 0.80
iterMethod · 0.45