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

Reverse properties of a node object, and their associated nodes.

Implementations§

source§

impl<T, B, M> ReverseProperties<T, B, M>

source

pub fn len(&self) -> usize

Returns the number of reverse properties.

source

pub fn is_empty(&self) -> bool

Checks if there are no defined reverse properties.

source

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

Returns an iterator over the reverse properties and their associated nodes.

source

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

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

source

pub fn clear(&mut self)

Removes all reverse properties.

source§

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

source

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

Checks if the given reverse property is associated to any node.

source

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

Returns an iterator over all the nodes associated to the given reverse property.

source

pub fn get_any<'a, Q>( &self, prop: &Q ) -> Option<&Meta<Indexed<Node<T, B, M>, M>, M>>where Q: Hash + Equivalent<Id<T, B>> + ?Sized, T: 'a,

Get one of the nodes associated to the given reverse property.

If multiple nodes are found, there are no guaranties on which node will be returned.

source

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

Associate the given node to the given reverse property.

source

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

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

source

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

Associate all the given nodes to the given reverse property.

source

pub fn insert_all_unique_stripped<Nodes>( &mut self, _: Meta<Id<T, B>, M>, values: Nodes )where Nodes: IntoIterator<Item = Stripped<Meta<Indexed<Node<T, B, M>, M>, M>>>,

Associate all the given nodes to the given reverse property, unless it is already.

source

pub fn insert_all_unique<Nodes>( &mut self, prop: Meta<Id<T, B>, M>, values: Nodes )where Nodes: IntoIterator<Item = Meta<Indexed<Node<T, B, M>, M>, M>>,

Associate all the given nodes to the given reverse property, unless it is already.

source

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

source

pub fn extend_unique_stripped<I, N>(&mut self, iter: I)where I: IntoIterator<Item = (Meta<Id<T, B>, M>, N)>, N: IntoIterator<Item = Stripped<Meta<Indexed<Node<T, B, M>, M>, M>>>,

source

pub fn remove( &mut self, prop: &Id<T, B> ) -> Option<Entry<Multiset<Stripped<Meta<Indexed<Node<T, B, M>, M>, M>>, DeterministicHasherBuilder>, M>>

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

Trait Implementations§

source§

impl<T, B, M> Clone for ReverseProperties<T, B, M>where T: Clone, B: Clone, M: Clone,

source§

fn clone(&self) -> ReverseProperties<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, B, M> Extend<(Meta<Id<T, B>, M>, Vec<Meta<Indexed<Node<T, B, M>, M>, M>, Global>)> for ReverseProperties<T, B, M>where T: Eq + Hash, B: Eq + Hash,

source§

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

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, B, M> Hash for ReverseProperties<T, B, M>where T: Hash, B: Hash, M: Hash,

source§

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

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 ReverseProperties<T, B, M>

§

type Item = (Meta<&'a Id<T, B>, &'a M>, &'a [Stripped<Meta<Indexed<Node<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) -> <&'a ReverseProperties<T, B, M> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
source§

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

§

type Item = (Meta<&'a Id<T, B>, &'a mut M>, &'a mut Multiset<Stripped<Meta<Indexed<Node<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 ) -> <&'a mut ReverseProperties<T, B, M> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
source§

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

§

type Item = (Meta<Id<T, B>, M>, Multiset<Stripped<Meta<Indexed<Node<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) -> <ReverseProperties<T, B, M> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
source§

impl<T, B, M, N> IntoJsonWithContextMeta<M, N> for ReverseProperties<T, B, M>where M: Clone, N: Vocabulary<Iri = T, BlankId = B>,

source§

fn into_json_meta_with(self, meta: M, vocabulary: &N) -> Meta<Value<M>, M>

source§

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

§

type BlankId = B

source§

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

Structural equality with mapped blank identifiers. Read more
source§

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

source§

fn eq(&self, other: &ReverseProperties<T, B, M>) -> 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, B, M, N> PrecomputeSizeWithContext<N> for ReverseProperties<T, B, M>where N: Vocabulary<Iri = T, BlankId = B>,

source§

fn contextual_pre_compute_size( &self, vocabulary: &N, options: &Options, sizes: &mut Vec<Size, Global> ) -> Size

source§

impl<T, B, M, N> PrintWithSizeAndContext<N> for ReverseProperties<T, B, M>where N: Vocabulary<Iri = T, BlankId = B>,

source§

fn contextual_fmt_with_size( &self, vocabulary: &N, f: &mut Formatter<'_>, options: &Options, indent: usize, sizes: &[Size], index: &mut usize ) -> Result<(), Error>

source§

impl<T, B, M> StrippedHash for ReverseProperties<T, B, M>where T: Hash, B: Hash,

source§

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

source§

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

source§

fn stripped_eq(&self, other: &ReverseProperties<T, B, M>) -> bool

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

impl<T, B, M> UnwindSafe for ReverseProperties<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

§

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

§

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
§

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>