pub struct PersonaNode {
pub persona_id: String,
pub entity_type: String,
pub relationships: HashMap<String, Vec<String>>,
pub metadata: HashMap<String, Value>,
}Expand description
Represents a node in the persona graph
Fields§
§persona_id: StringPersona ID
entity_type: StringEntity type (e.g., “user”, “order”, “payment”, “support_ticket”)
relationships: HashMap<String, Vec<String>>Relationships from this persona to others Key: relationship type (e.g., “has_orders”, “has_payments”) Value: List of related persona IDs
metadata: HashMap<String, Value>Additional metadata for the node
Implementations§
Source§impl PersonaNode
impl PersonaNode
Sourcepub fn add_relationship(
&mut self,
relationship_type: String,
related_persona_id: String,
)
pub fn add_relationship( &mut self, relationship_type: String, related_persona_id: String, )
Add a relationship to another persona
Get all related personas for a relationship type
Sourcepub fn get_relationship_types(&self) -> Vec<String>
pub fn get_relationship_types(&self) -> Vec<String>
Get all relationship types for this node
Trait Implementations§
Source§impl Clone for PersonaNode
impl Clone for PersonaNode
Source§fn clone(&self) -> PersonaNode
fn clone(&self) -> PersonaNode
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 PersonaNode
impl Debug for PersonaNode
Source§impl<'de> Deserialize<'de> for PersonaNode
impl<'de> Deserialize<'de> for PersonaNode
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 PersonaNode
impl RefUnwindSafe for PersonaNode
impl Send for PersonaNode
impl Sync for PersonaNode
impl Unpin for PersonaNode
impl UnwindSafe for PersonaNode
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