Struct ReverseProperties

Source
pub struct ReverseProperties<T = IriBuf, B = BlankIdBuf>(/* private fields */);
Expand description

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

Implementations§

Source§

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

Source

pub fn new() -> ReverseProperties<T, B>

Creates an empty map.

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>

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

Source

pub fn iter_mut( &mut self, ) -> IterMut<'_, Id<T, B>, Multiset<Indexed<Node<T, B>>>>

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> ReverseProperties<T, B>
where T: Eq + Hash, B: Eq + Hash,

Source

pub fn contains<Q>(&self, prop: &Q) -> bool
where 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>
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<&Indexed<Node<T, B>>>
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, prop: Id<T, B>, value: Indexed<Node<T, B>>)

Associate the given node to the given reverse property.

Source

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

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

Source

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

Associate all the given nodes to the given reverse property.

Source

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

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

Source

pub fn set(&mut self, prop: Id<T, B>, values: Multiset<Indexed<Node<T, B>>>)

Source

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

Source

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

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

Trait Implementations§

Source§

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

Source§

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

Returns a duplicate 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> Debug for ReverseProperties<T, B>
where T: Debug, B: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<T, B> Default for ReverseProperties<T, B>

Source§

fn default() -> ReverseProperties<T, B>

Returns the “default value” for a type. Read more
Source§

impl<T, B> Extend<(Id<T, B>, Vec<Indexed<Node<T, B>>>)> for ReverseProperties<T, B>
where T: Eq + Hash, B: Eq + Hash,

Source§

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

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, N> FromIterator<(Id<T, B>, N)> for ReverseProperties<T, B>
where T: Eq + Hash, B: Eq + Hash, N: IntoIterator<Item = Indexed<Node<T, B>>>,

Source§

fn from_iter<I>(iter: I) -> ReverseProperties<T, B>
where I: IntoIterator<Item = (Id<T, B>, N)>,

Creates a value from an iterator. Read more
Source§

impl<T, B> Hash for ReverseProperties<T, B>
where T: Hash, B: 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> IntoIterator for &'a ReverseProperties<T, B>

Source§

type Item = (&'a Id<T, B>, &'a [Indexed<Node<T, B>>])

The type of the elements being iterated over.
Source§

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

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

fn into_iter(self) -> <&'a ReverseProperties<T, B> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
Source§

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

Source§

type Item = (&'a Id<T, B>, &'a mut Multiset<Indexed<Node<T, B>>>)

The type of the elements being iterated over.
Source§

type IntoIter = IterMut<'a, Id<T, B>, Multiset<Indexed<Node<T, B>>>>

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

fn into_iter( self, ) -> <&'a mut ReverseProperties<T, B> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
Source§

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

Source§

type Item = (Id<T, B>, Multiset<Indexed<Node<T, B>>>)

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter<Id<T, B>, Multiset<Indexed<Node<T, B>>>>

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

fn into_iter(self) -> <ReverseProperties<T, B> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
Source§

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

Source§

fn into_json_with(self, vocabulary: &N) -> Value

Source§

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

Source§

type BlankId = B

Source§

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

Structural equality with mapped blank identifiers. Read more
Source§

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

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

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

Source§

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

Source§

impl<T, B, N> PrintWithSizeAndContext<N> for ReverseProperties<T, B>
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> TryFromJson<T, B> for ReverseProperties<T, B>
where T: Eq + Hash, B: Eq + Hash,

Source§

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

Source§

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

Source§

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

Source§

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

Auto Trait Implementations§

§

impl<T, B> Freeze for ReverseProperties<T, B>

§

impl<T, B> RefUnwindSafe for ReverseProperties<T, B>

§

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

§

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

§

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

§

impl<T, B> UnwindSafe for ReverseProperties<T, B>
where B: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where 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 T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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§

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

Source§

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

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where 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 Q
where 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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

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

Source§

impl<Q, K> Equivalent<K> for Q
where 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<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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

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

Source§

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

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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

Source§

type Owned = T

Source§

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

Source§

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 T
where U: IntoWithContext<T, C>,

Source§

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 T
where U: TryFrom<T>,

Source§

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 T
where U: TryFromWithContext<T, C>,

Source§

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 T
where T: ?Sized,

Source§

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

Source§

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

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,