pr4xis 0.5.0

Prove your domain is correct — ontology-driven rule enforcement with category theory, logical composition, and runtime state machines
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::fmt::Debug;

use super::entity::Entity;

/// A relationship between entities — a morphism in the category.
///
/// Every relationship has a source and target entity, representing
/// a directed connection between objects in the ontology.
pub trait Relationship: Sized + Clone + Debug + Eq {
    type Object: Entity;

    /// The entity this relationship originates from.
    fn source(&self) -> Self::Object;

    /// The entity this relationship points to.
    fn target(&self) -> Self::Object;
}