pub enum PropertyMap {
Standard(SmallVec<[(DbString, Value); 6]>),
Compact {
keys: Arc<[DbString]>,
values: SmallVec<[Option<Value>; 6]>,
},
}Expand description
Property storage for open and closed graph values.
Variants§
Standard(SmallVec<[(DbString, Value); 6]>)
Open graph representation: sorted key/value pairs.
Compact
Closed graph representation: fixed sorted keys with positional values.
Implementations§
Source§impl PropertyMap
impl PropertyMap
Sourcepub fn from_pairs(
pairs: impl IntoIterator<Item = (DbString, Value)>,
) -> CoreResult<Self>
pub fn from_pairs( pairs: impl IntoIterator<Item = (DbString, Value)>, ) -> CoreResult<Self>
Construct a standard property map from pairs, sorting by DbString order.
Later duplicate keys overwrite earlier keys.
§Errors
Returns CoreError::ConstructedValueTooLarge if the final distinct
key count exceeds the implementation-defined cardinality cap.
Sourcepub fn compact(
keys: impl IntoIterator<Item = DbString>,
values: impl IntoIterator<Item = Option<Value>>,
) -> CoreResult<Self>
pub fn compact( keys: impl IntoIterator<Item = DbString>, values: impl IntoIterator<Item = Option<Value>>, ) -> CoreResult<Self>
Construct a compact property map from a fixed schema key set.
Keys are sorted with their corresponding value slots. Duplicate keys keep the last value.
§Errors
Returns CoreError::ConstructedValueTooLarge if key count exceeds the
implementation-defined cardinality cap.
Sourcepub fn set(&mut self, key: DbString, value: Value) -> CoreResult<()>
pub fn set(&mut self, key: DbString, value: Value) -> CoreResult<()>
Set key to value.
Unknown-key writes against a compact map widen it to standard form and drop absent compact slots because standard maps only store present key/value pairs.
§Errors
Returns CoreError::ConstructedValueTooLarge if inserting a distinct
key would exceed the implementation-defined cardinality cap.
Sourcepub fn iter(&self) -> PropertyMapIter<'_> ⓘ
pub fn iter(&self) -> PropertyMapIter<'_> ⓘ
Iterate present key/value pairs in sorted-key order.
Returns a concrete PropertyMapIter (not a boxed trait object): this
is exercised per-label per-node on the commit path and per-write during
validation, so the allocation a Box<dyn Iterator> would cost on every
call is removed here.
Sourcepub fn keys(&self) -> PropertyMapKeys<'_> ⓘ
pub fn keys(&self) -> PropertyMapKeys<'_> ⓘ
Iterate present property keys in sorted-key order.
Sourcepub fn values(&self) -> PropertyMapValues<'_> ⓘ
pub fn values(&self) -> PropertyMapValues<'_> ⓘ
Iterate present property values in sorted-key order.
Sourcepub fn contains_key(&self, key: &DbString) -> bool
pub fn contains_key(&self, key: &DbString) -> bool
Return true if key has a present value.
Trait Implementations§
Source§impl Clone for PropertyMap
impl Clone for PropertyMap
Source§fn clone(&self) -> PropertyMap
fn clone(&self) -> PropertyMap
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 PropertyMap
impl Debug for PropertyMap
Source§impl Default for PropertyMap
impl Default for PropertyMap
Source§impl<'de> Deserialize<'de> for PropertyMap
impl<'de> Deserialize<'de> for PropertyMap
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Source§impl PartialEq for PropertyMap
impl PartialEq for PropertyMap
Source§fn eq(&self, other: &PropertyMap) -> bool
fn eq(&self, other: &PropertyMap) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for PropertyMap
impl Serialize for PropertyMap
impl StructuralPartialEq for PropertyMap
Auto Trait Implementations§
impl Freeze for PropertyMap
impl RefUnwindSafe for PropertyMap
impl Send for PropertyMap
impl Sync for PropertyMap
impl Unpin for PropertyMap
impl UnsafeUnpin for PropertyMap
impl UnwindSafe for PropertyMap
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.