pub struct Properties<T, B, M = ()>(_);
Expand description

Properties of a node object, and their associated objects.

Implementations§

source§

impl<T, B, M> Properties<T, B, M>

source

pub fn len(&self) -> usize

Returns the number of properties.

source

pub fn is_empty(&self) -> bool

Checks if there are no defined properties.

source

pub fn iter(&self) -> Iter<'_, T, B, M>

Returns an iterator over the properties and their associated objects.

source

pub fn iter_mut(&mut self) -> IterMut<'_, T, B, M>

Returns an iterator over the properties with a mutable reference to their associated objects.

source

pub fn clear(&mut self)

Removes all properties.

source§

impl<T: Eq + Hash, B: Eq + Hash, M> Properties<T, B, M>

source

pub fn contains<Q: ?Sized + Hash + Equivalent<Id<T, B>>>( &self, prop: &Q ) -> bool

Checks if the given property is associated to any object.

source

pub fn get<Q: ?Sized + Hash + Equivalent<Id<T, B>>>( &self, prop: &Q ) -> Objects<'_, T, B, M>

Returns an iterator over all the objects associated to the given property.

source

pub fn get_any<Q: ?Sized + Hash + Equivalent<Id<T, B>>>( &self, prop: &Q ) -> Option<&IndexedObject<T, B, M>>

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.

source

pub fn insert(&mut self, Meta: Meta<Id<T, B>, M>, value: IndexedObject<T, B, M>)

Associate the given object to the node through the given property.

source

pub fn insert_unique( &mut self, Meta: Meta<Id<T, B>, M>, value: IndexedObject<T, B, M> )

Associate the given object to the node through the given property, unless it is already.

source

pub fn insert_all<Objects: IntoIterator<Item = IndexedObject<T, B, M>>>( &mut self, Meta: Meta<Id<T, B>, M>, values: Objects )

Associate all the given objects to the node through the given property.

source

pub fn insert_all_unique_stripped<Objects: IntoIterator<Item = StrippedIndexedObject<T, B, M>>>( &mut self, Meta: Meta<Id<T, B>, M>, 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.

source

pub fn insert_all_unique<Objects: IntoIterator<Item = IndexedObject<T, B, M>>>( &mut self, prop: Meta<Id<T, B>, M>, 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.

source

pub fn extend_unique<I, O>(&mut self, iter: I)where I: IntoIterator<Item = (Meta<Id<T, B>, M>, O)>, O: IntoIterator<Item = IndexedObject<T, B, M>>,

source

pub fn extend_unique_stripped<I, O>(&mut self, iter: I)where I: IntoIterator<Item = (Meta<Id<T, B>, M>, O)>, O: IntoIterator<Item = StrippedIndexedObject<T, B, M>>,

source

pub fn remove(&mut self, prop: &Id<T, B>) -> Option<PropertyEntry<T, B, M>>

Removes and returns all the values associated to the given property.

Trait Implementations§

source§

impl<T: Clone, B: Clone, M: Clone> Clone for Properties<T, B, M>

source§

fn clone(&self) -> Properties<T, B, M>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<T: Eq + Hash, B: Eq + Hash, M> Extend<(Meta<Id<T, B>, M>, Vec<Meta<Indexed<Object<T, B, M>, M>, M>, Global>)> for Properties<T, B, M>

source§

fn extend<I>(&mut self, iter: I)where I: IntoIterator<Item = (Meta<Id<T, B>, M>, Vec<IndexedObject<T, B, M>>)>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl<T: Hash, B: Hash, M: Hash> Hash for Properties<T, B, M>

source§

fn hash<H: Hasher>(&self, h: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<'a, T, B, M> IntoIterator for &'a Properties<T, B, M>

§

type Item = (Meta<&'a Id<T, B>, &'a M>, &'a [Stripped<Meta<Indexed<Object<T, B, M>, M>, M>>])

The type of the elements being iterated over.
§

type IntoIter = Iter<'a, T, B, M>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<'a, T, B, M> IntoIterator for &'a mut Properties<T, B, M>

§

type Item = (Meta<&'a Id<T, B>, &'a mut M>, &'a mut Multiset<Stripped<Meta<Indexed<Object<T, B, M>, M>, M>>, DeterministicHasherBuilder>)

The type of the elements being iterated over.
§

type IntoIter = IterMut<'a, T, B, M>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<T, B, M> IntoIterator for Properties<T, B, M>

§

type Item = (Meta<Id<T, B>, M>, Multiset<Stripped<Meta<Indexed<Object<T, B, M>, M>, M>>, DeterministicHasherBuilder>)

The type of the elements being iterated over.
§

type IntoIter = IntoIter<T, B, M>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<T: Eq + Hash, B: Eq + Hash, M> MappedEq<Properties<T, B, M>> for Properties<T, B, M>

§

type BlankId = B

source§

fn mapped_eq<'a, 'b, F: Clone + Fn(&'a B) -> &'b B>( &'a self, other: &Self, f: F ) -> boolwhere B: 'a + 'b,

Structural equality with mapped blank identifiers. Read more
source§

impl<T, B, M> PartialEq<Properties<T, B, M>> for Properties<T, B, M>where T: Eq + Hash, B: Eq + Hash, M: PartialEq,

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T: Hash, B: Hash, M> StrippedHash for Properties<T, B, M>

source§

impl<T: Eq + Hash, B: Eq + Hash, M> StrippedPartialEq<Properties<T, B, M>> for Properties<T, B, M>

source§

fn stripped_eq(&self, other: &Self) -> bool

source§

impl<T: Eq + Hash, B: Eq + Hash, M> TryFromJson<T, B, M> for Properties<T, B, M>

source§

fn try_from_json_in( vocabulary: &mut impl VocabularyMut<Iri = T, BlankId = B>, Meta: Meta<Value<M>, M> ) -> Result<Meta<Self, M>, Meta<InvalidExpandedJson<M>, M>>

source§

impl<T: Eq + Hash, B: Eq + Hash, M> TryFromJsonObject<T, B, M> for Properties<T, B, M>

source§

fn try_from_json_object_in( vocabulary: &mut impl VocabularyMut<Iri = T, BlankId = B>, Meta: Meta<Object<M>, M> ) -> Result<Meta<Self, M>, Meta<InvalidExpandedJson<M>, M>>

source§

impl<T, B, M> Eq for Properties<T, B, M>where T: Eq + Hash, B: Eq + Hash, M: Eq,

source§

impl<T: Eq + Hash, B: Eq + Hash, M> StrippedEq for Properties<T, B, M>

Auto Trait Implementations§

§

impl<T, B, M> RefUnwindSafe for Properties<T, B, M>where B: RefUnwindSafe, M: RefUnwindSafe, T: RefUnwindSafe,

§

impl<T, B, M> Send for Properties<T, B, M>where B: Send, M: Send, T: Send,

§

impl<T, B, M> Sync for Properties<T, B, M>where B: Sync, M: Sync, T: Sync,

§

impl<T, B, M> Unpin for Properties<T, B, M>where B: Unpin, M: Unpin, T: Unpin,

§

impl<T, B, M> UnwindSafe for Properties<T, B, M>where B: UnwindSafe, M: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> At for T

source§

fn at<M>(self, metadata: M) -> Meta<T, M>

Wraps self inside a Meta<Self, M> using the given metadata. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> BorrowStripped for T

source§

fn stripped(&self) -> &Stripped<T>

source§

impl<T> BorrowUnordered for T

source§

fn unordered(&self) -> &Unordered<T>

§

impl<T> CallHasher for Twhere T: Hash + ?Sized,

§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64where H: Hash + ?Sized, B: BuildHasher,

source§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

source§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, C> FromWithContext<T, C> for T

source§

fn from_with(value: T, _context: &C) -> T

source§

impl<T, U> Into<U> for Twhere 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, U, C> IntoWithContext<U, C> for Twhere U: FromWithContext<T, C>,

source§

fn into_with(self, context: &C) -> U

source§

impl<T> ToOwned for Twhere T: Clone,

§

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> ToOwned for T

§

type Owned = T

source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U, C> TryFromWithContext<U, C> for Twhere U: IntoWithContext<T, C>,

§

type Error = Infallible

source§

fn try_from_with( value: U, context: &C ) -> Result<T, <T as TryFromWithContext<U, C>>::Error>

source§

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

§

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.
source§

impl<T, U, C> TryIntoWithContext<U, C> for Twhere U: TryFromWithContext<T, C>,

§

type Error = <U as TryFromWithContext<T, C>>::Error

source§

fn try_into_with( self, context: &C ) -> Result<U, <T as TryIntoWithContext<U, C>>::Error>

source§

impl<T> WithContext for Twhere T: ?Sized,

source§

fn with<C>(&self, context: C) -> Contextual<&T, C>

source§

fn into_with<C>(self, context: C) -> Contextual<T, C>