pub trait IsGeometryTable {
type Key: IsGeometryKey;
type Item: GeometricPrimitive;
// Required methods
fn get(&self, key: &Self::Key) -> Option<Self::Item>;
fn insert(
&mut self,
key: Self::Key,
value: Self::Item,
) -> Result<(), ErrorsJSL>;
fn remove(&mut self, key: &Self::Key) -> Option<Self::Item>;
fn contains_key(&self, key: &Self::Key) -> bool;
fn size(&self) -> usize;
fn union(&self, other: &Self) -> Self
where Self: Sized;
fn intersection(&self, other: &Self) -> Self
where Self: Sized;
fn iter(&self) -> Box<dyn Iterator<Item = (Self::Key, Self::Item)> + '_>;
fn to_file(&self, path: &str) -> Result<(), ErrorsJSL>;
fn from_file(path: &str) -> Result<Self, ErrorsJSL>
where Self: Sized;
}Expand description
Abstraction over a keyed mutable collection of geometry primitives.
Required Associated Types§
Sourcetype Key: IsGeometryKey
type Key: IsGeometryKey
Stable key used to address items in the table.
Sourcetype Item: GeometricPrimitive
type Item: GeometricPrimitive
Item stored by the table.
Required Methods§
Sourcefn get(&self, key: &Self::Key) -> Option<Self::Item>
fn get(&self, key: &Self::Key) -> Option<Self::Item>
Returns the item stored at key, if present.
Sourcefn insert(&mut self, key: Self::Key, value: Self::Item) -> Result<(), ErrorsJSL>
fn insert(&mut self, key: Self::Key, value: Self::Item) -> Result<(), ErrorsJSL>
Inserts or replaces the item stored at key.
Sourcefn remove(&mut self, key: &Self::Key) -> Option<Self::Item>
fn remove(&mut self, key: &Self::Key) -> Option<Self::Item>
Removes and returns the item stored at key, if present.
Sourcefn contains_key(&self, key: &Self::Key) -> bool
fn contains_key(&self, key: &Self::Key) -> bool
Returns true if key exists in the table.
Sourcefn intersection(&self, other: &Self) -> Selfwhere
Self: Sized,
fn intersection(&self, other: &Self) -> Selfwhere
Self: Sized,
Computes the intersection of two tables.
Sourcefn iter(&self) -> Box<dyn Iterator<Item = (Self::Key, Self::Item)> + '_>
fn iter(&self) -> Box<dyn Iterator<Item = (Self::Key, Self::Item)> + '_>
Iterates immutably over key/value pairs in the table.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".