Skip to main content

HashGeometryTable

Struct HashGeometryTable 

Source
pub struct HashGeometryTable<K, V> { /* private fields */ }
Expand description

Hash-backed keyed geometry table implementation.

This is the default concrete table type used by GeometryTableRegistry.

Implementations§

Source§

impl<K, V> HashGeometryTable<K, V>

Source

pub fn new() -> Self

Creates an empty hash-backed geometry table.

Trait Implementations§

Source§

impl<K: Clone, V: Clone> Clone for HashGeometryTable<K, V>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<K: Debug, V: Debug> Debug for HashGeometryTable<K, V>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<K, V> Default for HashGeometryTable<K, V>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<K, V> IsGeometryTable for HashGeometryTable<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.

Auto Trait Implementations§

§

impl<K, V> Freeze for HashGeometryTable<K, V>

§

impl<K, V> RefUnwindSafe for HashGeometryTable<K, V>

§

impl<K, V> Send for HashGeometryTable<K, V>
where K: Send, V: Send,

§

impl<K, V> Sync for HashGeometryTable<K, V>
where K: Sync, V: Sync,

§

impl<K, V> Unpin for HashGeometryTable<K, V>
where K: Unpin, V: Unpin,

§

impl<K, V> UnsafeUnpin for HashGeometryTable<K, V>

§

impl<K, V> UnwindSafe for HashGeometryTable<K, V>
where K: UnwindSafe, V: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> MaybeSerialize for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.