pub struct Entity {
pub id: String,
pub name: String,
pub entity_type: EntityType,
pub description: Option<String>,
pub created_by: String,
pub created_at: i64,
pub members: Vec<String>,
pub parent_org_id: Option<String>,
pub network_four_words: Option<String>,
pub is_local_only: bool,
pub linked_at: Option<i64>,
pub last_sync_at: Option<i64>,
}Expand description
Entity information
Fields§
§id: String§name: String§entity_type: EntityType§description: Option<String>§created_by: String§created_at: i64§members: Vec<String>§parent_org_id: Option<String>§network_four_words: Option<String>Network four-word identity if this entity is linked to the P2P network
is_local_only: boolTrue if this is a local-only placeholder (no network identity yet)
linked_at: Option<i64>Timestamp when entity was linked to a network identity
last_sync_at: Option<i64>Timestamp of last successful sync with network peer
Implementations§
Source§impl Entity
impl Entity
Sourcepub fn new_local(
name: String,
entity_type: EntityType,
description: Option<String>,
created_by: String,
) -> Self
pub fn new_local( name: String, entity_type: EntityType, description: Option<String>, created_by: String, ) -> Self
Create a new local-only entity (placeholder without network identity)
Sourcepub fn link_to_network(&mut self, four_words: String)
pub fn link_to_network(&mut self, four_words: String)
Link this entity to a network identity
Sourcepub fn mark_synced(&mut self)
pub fn mark_synced(&mut self)
Update the last sync timestamp
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Entity
impl<'de> Deserialize<'de> for Entity
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
impl Eq for Entity
impl StructuralPartialEq for Entity
Auto Trait Implementations§
impl Freeze for Entity
impl RefUnwindSafe for Entity
impl Send for Entity
impl Sync for Entity
impl Unpin for Entity
impl UnwindSafe for Entity
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.