relationship

The relationships table: directed links, such as blocks or child-of, between two entities.

struct Model

source

pub struct Model

A directed relationship between two entities.

Field Type Description
created_at DateTime<Utc> When the relationship was first recorded.
id Id Stable identifier assigned at creation.
rel_type RelationshipType Semantic kind of relationship (e.g. blocks, parent-of).
source_id Id Identifier of the source (from-side) entity.
source_type EntityType Which domain type source_id refers to.
target_id Id Identifier of the target (to-side) entity.
target_type EntityType Which domain type target_id refers to.
updated_at DateTime<Utc> When the relationship row was last modified.

Implements Clone, Debug, Deserialize<'de>, Eq, PartialEq, Serialize, TryFrom<Row>, From<&Model>.

Model::rel_type

source

pub fn rel_type(&self) -> RelationshipType

Semantic kind of relationship (e.g. blocks, parent-of).

Parameter Type Description
returns RelationshipType

Model::source_type

source

pub fn source_type(&self) -> EntityType

Which domain type source_id refers to.

Parameter Type Description
returns EntityType

Model::target_type

source

pub fn target_type(&self) -> EntityType

Which domain type target_id refers to.

Parameter Type Description
returns EntityType

Model::created_at

source

pub fn created_at(&self) -> &DateTime<Utc>

When the relationship was first recorded.

Parameter Type Description
returns &DateTime<Utc>

Model::id

source

pub fn id(&self) -> &Id

Stable identifier assigned at creation.

Parameter Type Description
returns &Id

Model::source_id

source

pub fn source_id(&self) -> &Id

Identifier of the source (from-side) entity.

Parameter Type Description
returns &Id

Model::target_id

source

pub fn target_id(&self) -> &Id

Identifier of the target (to-side) entity.

Parameter Type Description
returns &Id

Model::updated_at

source

pub fn updated_at(&self) -> &DateTime<Utc>

When the relationship row was last modified.

Parameter Type Description
returns &DateTime<Utc>