Link

Trait Link 

Source
pub trait Link: Entity {
    // Required methods
    fn source_id(&self) -> Uuid;
    fn target_id(&self) -> Uuid;
    fn link_type(&self) -> &str;

    // Provided method
    fn display(&self) { ... }
}
Expand description

Trait for link entities that represent relationships between entities.

Links extend the base Entity with:

  • source_id: The ID of the source entity
  • target_id: The ID of the target entity
  • link_type: The type of relationship

Required Methods§

Source

fn source_id(&self) -> Uuid

Get the source entity ID

Source

fn target_id(&self) -> Uuid

Get the target entity ID

Get the link type (e.g., “owner”, “worker”)

Provided Methods§

Source

fn display(&self)

Display the link for debugging

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§