pub struct Properties<T, B>(/* private fields */);
Expand description
Properties of a node object, and their associated objects.
Implementations§
Source§impl<T, B> Properties<T, B>
impl<T, B> Properties<T, B>
Source§impl<T: Eq + Hash, B: Eq + Hash> Properties<T, B>
impl<T: Eq + Hash, B: Eq + Hash> Properties<T, B>
Sourcepub fn contains<Q: ?Sized + Hash + Equivalent<Id<T, B>>>(
&self,
prop: &Q,
) -> bool
pub fn contains<Q: ?Sized + Hash + Equivalent<Id<T, B>>>( &self, prop: &Q, ) -> bool
Checks if the given property is associated to any object.
Sourcepub fn get<Q: ?Sized + Hash + Equivalent<Id<T, B>>>(
&self,
prop: &Q,
) -> Objects<'_, T, B> ⓘ
pub fn get<Q: ?Sized + Hash + Equivalent<Id<T, B>>>( &self, prop: &Q, ) -> Objects<'_, T, B> ⓘ
Returns an iterator over all the objects associated to the given property.
Sourcepub fn get_any<Q: ?Sized + Hash + Equivalent<Id<T, B>>>(
&self,
prop: &Q,
) -> Option<&IndexedObject<T, B>>
pub fn get_any<Q: ?Sized + Hash + Equivalent<Id<T, B>>>( &self, prop: &Q, ) -> Option<&IndexedObject<T, B>>
Get one of the objects associated to the given property.
If multiple objects are found, there are no guaranties on which object will be returned.
Sourcepub fn insert(&mut self, prop: Id<T, B>, value: IndexedObject<T, B>)
pub fn insert(&mut self, prop: Id<T, B>, value: IndexedObject<T, B>)
Associate the given object to the node through the given property with metadata.
Sourcepub fn insert_unique(&mut self, prop: Id<T, B>, value: IndexedObject<T, B>)
pub fn insert_unique(&mut self, prop: Id<T, B>, value: IndexedObject<T, B>)
Associate the given object to the node through the given property, unless it is already.
Sourcepub fn insert_all<Objects: IntoIterator<Item = IndexedObject<T, B>>>(
&mut self,
prop: Id<T, B>,
values: Objects,
)
pub fn insert_all<Objects: IntoIterator<Item = IndexedObject<T, B>>>( &mut self, prop: Id<T, B>, values: Objects, )
Associate all the given objects to the node through the given property.
Sourcepub fn insert_all_unique<Objects: IntoIterator<Item = IndexedObject<T, B>>>(
&mut self,
prop: Id<T, B>,
values: Objects,
)
pub fn insert_all_unique<Objects: IntoIterator<Item = IndexedObject<T, B>>>( &mut self, prop: Id<T, B>, values: Objects, )
Associate all the given objects to the node through the given property, unless it is already.
The equivalence operator is used to remove equivalent objects.
pub fn set(&mut self, prop: Id<T, B>, values: PropertyObjects<T, B>)
pub fn extend_unique<I, O>(&mut self, iter: I)
Sourcepub fn remove<Q: ?Sized + Hash + Equivalent<Id<T, B>>>(
&mut self,
prop: &Q,
) -> Option<PropertyObjects<T, B>>
pub fn remove<Q: ?Sized + Hash + Equivalent<Id<T, B>>>( &mut self, prop: &Q, ) -> Option<PropertyObjects<T, B>>
Removes and returns all the values associated to the given property.
Trait Implementations§
Source§impl<T: Clone, B: Clone> Clone for Properties<T, B>
impl<T: Clone, B: Clone> Clone for Properties<T, B>
Source§fn clone(&self) -> Properties<T, B>
fn clone(&self) -> Properties<T, B>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<T, B> Default for Properties<T, B>
impl<T, B> Default for Properties<T, B>
Source§impl<T: Eq + Hash, B: Eq + Hash> Extend<(Id<T, B>, Vec<Indexed<Object<T, B>>>)> for Properties<T, B>
impl<T: Eq + Hash, B: Eq + Hash> Extend<(Id<T, B>, Vec<Indexed<Object<T, B>>>)> for Properties<T, B>
Source§fn extend<I>(&mut self, iter: I)
fn extend<I>(&mut self, iter: I)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Source§impl<T: Eq + Hash, B: Eq + Hash, O> FromIterator<(Id<T, B>, O)> for Properties<T, B>where
O: IntoIterator<Item = IndexedObject<T, B>>,
impl<T: Eq + Hash, B: Eq + Hash, O> FromIterator<(Id<T, B>, O)> for Properties<T, B>where
O: IntoIterator<Item = IndexedObject<T, B>>,
Source§impl<'a, T, B> IntoIterator for &'a Properties<T, B>
impl<'a, T, B> IntoIterator for &'a Properties<T, B>
Source§impl<'a, T, B> IntoIterator for &'a mut Properties<T, B>
impl<'a, T, B> IntoIterator for &'a mut Properties<T, B>
Source§impl<T, B> IntoIterator for Properties<T, B>
impl<T, B> IntoIterator for Properties<T, B>
Source§impl<T, B> PartialEq for Properties<T, B>
impl<T, B> PartialEq for Properties<T, B>
Source§impl<T: Eq + Hash, B: Eq + Hash> TryFromJson<T, B> for Properties<T, B>
impl<T: Eq + Hash, B: Eq + Hash> TryFromJson<T, B> for Properties<T, B>
fn try_from_json_in( vocabulary: &mut impl VocabularyMut<Iri = T, BlankId = B>, value: Value, ) -> Result<Self, InvalidExpandedJson>
Source§impl<T: Eq + Hash, B: Eq + Hash> TryFromJsonObject<T, B> for Properties<T, B>
impl<T: Eq + Hash, B: Eq + Hash> TryFromJsonObject<T, B> for Properties<T, B>
fn try_from_json_object_in( vocabulary: &mut impl VocabularyMut<Iri = T, BlankId = B>, object: Object, ) -> Result<Self, InvalidExpandedJson>
impl<T, B> Eq for Properties<T, B>
Auto Trait Implementations§
impl<T, B> Freeze for Properties<T, B>
impl<T, B> RefUnwindSafe for Properties<T, B>where
B: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, B> Send for Properties<T, B>
impl<T, B> Sync for Properties<T, B>
impl<T, B> Unpin for Properties<T, B>
impl<T, B> UnwindSafe for Properties<T, B>where
B: UnwindSafe,
T: UnwindSafe,
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> BorrowUnordered for T
impl<T> BorrowUnordered for T
fn as_unordered(&self) -> &Unordered<T>
Source§impl<T> CallHasher for T
impl<T> CallHasher for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
fn equivalent(&self, key: &K) -> bool
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.