Skip to main content

SharedGeometryTable

Type Alias SharedGeometryTable 

Source
pub type SharedGeometryTable<K, V> = Rc<RefCell<HashGeometryTable<K, V>>>;
Expand description

Shared interior-mutable handle to a hash-backed geometry table.

This alias is used throughout the concrete API so multiple primitives can reference the same logical table without taking ownership of it.

Aliased Type§

pub struct SharedGeometryTable<K, V> { /* private fields */ }

Trait Implementations§

Source§

impl<K, V> IsGeometryTable for SharedGeometryTable<K, V>

Source§

type Key = K

Stable key used to address items in the table.
Source§

type Item = V

Item stored by the table.
Source§

fn get(&self, key: &Self::Key) -> Option<Self::Item>

Returns the item stored at key, if present.
Source§

fn insert(&mut self, key: Self::Key, value: Self::Item) -> Result<(), ErrorsJSL>

Inserts or replaces the item stored at key.
Source§

fn remove(&mut self, key: &Self::Key) -> Option<Self::Item>

Removes and returns the item stored at key, if present.
Source§

fn contains_key(&self, key: &Self::Key) -> bool

Returns true if key exists in the table.
Source§

fn size(&self) -> usize

Returns the number of items held by the table.
Source§

fn union(&self, other: &Self) -> Self

Computes the union of two tables.
Source§

fn intersection(&self, other: &Self) -> Self

Computes the intersection of two tables.
Source§

fn iter(&self) -> Box<dyn Iterator<Item = (Self::Key, Self::Item)> + '_>

Iterates immutably over key/value pairs in the table.
Source§

fn to_file(&self, path: &str) -> Result<(), ErrorsJSL>

Serializes the table to a file (as JSON for the library’s tables; requires the serde feature, and returns an error without it).
Source§

fn from_file(path: &str) -> Result<Self, ErrorsJSL>
where Self: Sized,

Loads a table instance from a file.