pub struct RelationshipManager { /* private fields */ }
Expand description
Manages entity relationships and reference lookups
Implementations§
Source§impl RelationshipManager
impl RelationshipManager
Sourcepub fn register(
&mut self,
entity_type: EntityType,
id: String,
reference: String,
)
pub fn register( &mut self, entity_type: EntityType, id: String, reference: String, )
Register an entity with its reference
Sourcepub fn get_reference(&self, entity_type: EntityType, id: &str) -> Option<String>
pub fn get_reference(&self, entity_type: EntityType, id: &str) -> Option<String>
Get reference for an entity
Sourcepub fn get_entity_by_reference(
&self,
reference: &str,
) -> Option<(EntityType, String)>
pub fn get_entity_by_reference( &self, reference: &str, ) -> Option<(EntityType, String)>
Get entity info by reference
Sourcepub fn reference_exists(&self, reference: &str) -> bool
pub fn reference_exists(&self, reference: &str) -> bool
Check if a reference exists
Sourcepub fn add_relationship(&mut self, from_ref: String, to_ref: String)
pub fn add_relationship(&mut self, from_ref: String, to_ref: String)
Add a relationship between two entities
Sourcepub fn get_relationships(&self, reference: &str) -> Option<&IndexSet<String>>
pub fn get_relationships(&self, reference: &str) -> Option<&IndexSet<String>>
Get all related references for an entity
Sourcepub fn get_all(&self) -> IndexMap<EntityType, IndexMap<String, String>>
pub fn get_all(&self) -> IndexMap<EntityType, IndexMap<String, String>>
Get all registered references (for debugging)
Sourcepub fn get_statistics(&self) -> RelationshipStatistics
pub fn get_statistics(&self) -> RelationshipStatistics
Get statistics about registered entities
Trait Implementations§
Source§impl Clone for RelationshipManager
impl Clone for RelationshipManager
Source§fn clone(&self) -> RelationshipManager
fn clone(&self) -> RelationshipManager
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 RelationshipManager
impl Debug for RelationshipManager
Source§impl Default for RelationshipManager
impl Default for RelationshipManager
Source§fn default() -> RelationshipManager
fn default() -> RelationshipManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RelationshipManager
impl RefUnwindSafe for RelationshipManager
impl Send for RelationshipManager
impl Sync for RelationshipManager
impl Unpin for RelationshipManager
impl UnwindSafe for RelationshipManager
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more