shapely-core 3.1.0

Core types and traits for the shapely ecosystem, providing fundamental reflection capabilities
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/// Virtual table for a list-like type (like `Vec<T>`,
/// but also `HashSet<T>`, etc.)
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq)]
pub struct ListVTable {
    /// init given pointer to be an empty vec (with capacity)
    pub init: unsafe fn(ptr: *mut u8, size_hint: Option<usize>),

    /// push an item
    pub push: unsafe fn(*mut u8, crate::Partial),

    /// get length of the collection
    pub len: unsafe fn(ptr: *const u8) -> usize,

    /// get address of the item at the given index. panics if out of bound.
    pub get_item_ptr: unsafe fn(ptr: *const u8, index: usize) -> *const u8,
}