pub struct DatumStore { /* private fields */ }Expand description
The store of transforms that Location chains refer into.
One per document. Interning is not an optimisation here; it is what gives placements a stable notion of sameness, since two chains naming the same datum are known to agree without any floating-point comparison.
§Handles are relative to their store, and know it
A DatumId means nothing without the store that issued it, and it says
which one that was. A handle from another store resolves to None rather
than to whatever transform happens to sit at that index, so mixing
documents is an error that shows up where it happens rather than a wrong
answer several operations later.
Implementations§
Source§impl DatumStore
impl DatumStore
Sourcepub fn insert(&mut self, transform: Datum) -> DatumId
pub fn insert(&mut self, transform: Datum) -> DatumId
Intern a transform, returning a handle to it.
Identical transforms are not deduplicated: recognising two matrices as equal is a tolerance question, and the whole point of the chain representation is to avoid asking it. Callers that want sharing hold on to the handle.
Trait Implementations§
Source§impl Clone for DatumStore
impl Clone for DatumStore
Source§fn clone(&self) -> DatumStore
fn clone(&self) -> DatumStore
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DatumStore
impl Debug for DatumStore
Source§impl Default for DatumStore
impl Default for DatumStore
Source§fn default() -> DatumStore
fn default() -> DatumStore
Auto Trait Implementations§
impl Freeze for DatumStore
impl RefUnwindSafe for DatumStore
impl Send for DatumStore
impl Sync for DatumStore
impl Unpin for DatumStore
impl UnsafeUnpin for DatumStore
impl UnwindSafe for DatumStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.