shapely_core/shape/
map_shape.rs

1/// Virtual table for a Map<String, T>
2#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq)]
3pub struct MapVTable {
4    /// Initialize an empty map at the given pointer
5    pub init: unsafe fn(ptr: *mut u8, size_hint: Option<usize>),
6
7    /// Insert a key-value pair into the map
8    pub insert: unsafe fn(*mut u8, key: crate::Partial, value: crate::Partial),
9
10    /// Get the number of entries in the map
11    pub len: unsafe fn(ptr: *const u8) -> usize,
12
13    /// Check if the map contains a key
14    pub contains_key: unsafe fn(ptr: *const u8, key: &str) -> bool,
15
16    /// Get pointer to a value for a given key, returns null if not found
17    pub get_value_ptr: unsafe fn(ptr: *const u8, key: &str) -> *const u8,
18
19    /// Get an iterator over the map
20    pub iter: unsafe fn(ptr: *const u8) -> *const u8,
21
22    /// Virtual table for map iterator operations
23    pub iter_vtable: MapIterVTable,
24}
25
26/// VTable for an iterator over a map
27#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq)]
28pub struct MapIterVTable {
29    /// Get the next key-value pair from the iterator
30    pub next: unsafe fn(*const u8) -> Option<(*const String, *const u8)>,
31
32    /// Deallocate the iterator
33    pub dealloc: unsafe fn(*const u8),
34}