pub struct EntityNode {
pub entity_id: GraphEntityId,
pub name: String,
pub attributes: HashMap<String, String>,
pub created_date: NaiveDate,
pub is_active: bool,
pub company_code: Option<String>,
}Expand description
Node in the entity graph.
Fields§
§entity_id: GraphEntityIdEntity identifier
name: StringDisplay name
attributes: HashMap<String, String>Entity attributes (flexible key-value)
created_date: NaiveDateCreation date
is_active: boolIs entity active
company_code: Option<String>Company code (if applicable)
Implementations§
Source§impl EntityNode
impl EntityNode
Sourcepub fn new(
entity_id: GraphEntityId,
name: impl Into<String>,
created_date: NaiveDate,
) -> Self
pub fn new( entity_id: GraphEntityId, name: impl Into<String>, created_date: NaiveDate, ) -> Self
Create a new entity node.
Sourcepub fn with_attribute(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_attribute( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Add an attribute.
Sourcepub fn with_company(self, company_code: impl Into<String>) -> Self
pub fn with_company(self, company_code: impl Into<String>) -> Self
Set company code.
Trait Implementations§
Source§impl Clone for EntityNode
impl Clone for EntityNode
Source§fn clone(&self) -> EntityNode
fn clone(&self) -> EntityNode
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 EntityNode
impl Debug for EntityNode
Source§impl<'de> Deserialize<'de> for EntityNode
impl<'de> Deserialize<'de> for EntityNode
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 EntityNode
impl RefUnwindSafe for EntityNode
impl Send for EntityNode
impl Sync for EntityNode
impl Unpin for EntityNode
impl UnwindSafe for EntityNode
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