shapely_core/shape/list_shape.rs
1/// Virtual table for a list-like type (like `Vec<T>`,
2/// but also `HashSet<T>`, etc.)
3#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq)]
4pub struct ListVTable {
5 /// init given pointer to be an empty vec (with capacity)
6 pub init: unsafe fn(ptr: *mut u8, size_hint: Option<usize>),
7
8 /// push an item
9 pub push: unsafe fn(*mut u8, crate::Partial),
10
11 /// get length of the collection
12 pub len: unsafe fn(ptr: *const u8) -> usize,
13
14 /// get address of the item at the given index. panics if out of bound.
15 pub get_item_ptr: unsafe fn(ptr: *const u8, index: usize) -> *const u8,
16}