[go: up one dir, main page]

extract_map 0.3.1

A HashMap for memory efficent storage of value types which contain their own keys.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use typesize::{if_typesize_details, TypeSize};

use crate::ExtractMap;

impl<K, V: TypeSize, S: TypeSize> TypeSize for ExtractMap<K, V, S> {
    fn extra_size(&self) -> usize {
        self.table.extra_size() + self.build_hasher.extra_size()
    }

    if_typesize_details! {
        fn get_collection_item_count(&self) -> Option<usize> {
            Some(self.len())
        }
    }
}