pub struct RelationshipIndex { /* private fields */ }Expand description
Index for fast relationship lookups.
Implementations§
Source§impl RelationshipIndex
impl RelationshipIndex
Sourcepub fn add(&mut self, relationship: ObjectRelationship)
pub fn add(&mut self, relationship: ObjectRelationship)
Add a relationship to the index.
Sourcepub fn get_outgoing(&self, source_id: Uuid) -> Vec<&ObjectRelationship>
pub fn get_outgoing(&self, source_id: Uuid) -> Vec<&ObjectRelationship>
Get all relationships from a source object.
Sourcepub fn get_incoming(&self, target_id: Uuid) -> Vec<&ObjectRelationship>
pub fn get_incoming(&self, target_id: Uuid) -> Vec<&ObjectRelationship>
Get all relationships to a target object.
Sourcepub fn get_by_type(&self, relationship_type: &str) -> Vec<&ObjectRelationship>
pub fn get_by_type(&self, relationship_type: &str) -> Vec<&ObjectRelationship>
Get all relationships of a specific type.
Sourcepub fn all(&self) -> &[ObjectRelationship]
pub fn all(&self) -> &[ObjectRelationship]
Get all relationships.
Sourcepub fn iter(&self) -> impl Iterator<Item = &ObjectRelationship>
pub fn iter(&self) -> impl Iterator<Item = &ObjectRelationship>
Iterate over all relationships.
Trait Implementations§
Source§impl Clone for RelationshipIndex
impl Clone for RelationshipIndex
Source§fn clone(&self) -> RelationshipIndex
fn clone(&self) -> RelationshipIndex
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RelationshipIndex
impl Debug for RelationshipIndex
Source§impl Default for RelationshipIndex
impl Default for RelationshipIndex
Source§fn default() -> RelationshipIndex
fn default() -> RelationshipIndex
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for RelationshipIndex
impl<'de> Deserialize<'de> for RelationshipIndex
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RelationshipIndex
impl RefUnwindSafe for RelationshipIndex
impl Send for RelationshipIndex
impl Sync for RelationshipIndex
impl Unpin for RelationshipIndex
impl UnwindSafe for RelationshipIndex
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
Mutably borrows from an owned value. Read more