pub struct Link {
pub id: Uuid,
pub tenant_id: Uuid,
pub link_type: String,
pub source: EntityReference,
pub target: EntityReference,
pub metadata: Option<Value>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Expand description
A polymorphic link between two entities
Links are completely agnostic to the types of entities they connect. This allows the link system to work with any entity types without modification.
Fields§
§id: UuidUnique identifier for this link
tenant_id: UuidTenant ID for multi-tenant isolation
link_type: StringThe type of relationship (e.g., “owner”, “driver”, “worker”)
CRITICAL: This is a String, not an enum, to support any relationship type without modifying the core framework
source: EntityReferenceThe source entity in this relationship
target: EntityReferenceThe target entity in this relationship
metadata: Option<Value>Optional metadata for the relationship
Can store additional context like:
- start_date / end_date for temporal relationships
- role for employment relationships
- permission level for access relationships
created_at: DateTime<Utc>When this link was created
updated_at: DateTime<Utc>When this link was last updated
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Link
impl<'de> Deserialize<'de> for Link
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 Link
impl RefUnwindSafe for Link
impl Send for Link
impl Sync for Link
impl Unpin for Link
impl UnwindSafe for Link
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