Rust librariesmars-protocol
mars-protocol · relationships
Public declarations and documentation for mars-protocol::relationships.
Package: mars-protocol · Workspace version: 0.1.0 · Module: relationships
This reference follows declared modules and public syntax, including public implementation methods. Function bodies and constant values are omitted. Feature conditions are retained. Private-module re-exports and trait resolution require the compiler; not every declaration is a root import.
relationships::Relationship
A typed directional relationship between two MARS entries.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(feature = "contracts", derive(schemars::JsonSchema, utoipa::ToSchema))]
#[serde(rename_all = "camelCase")]
pub struct Relationship {
/// The kind of relationship.
pub relationship_type: RelationshipType,
/// The DID of the target entry.
pub target_did: String,
/// Optional human-readable label for the relationship.
#[serde(skip_serializing_if = "Option::is_none")]
pub label: Option<String>
}Source line: 14.
relationships::RelationshipType
Supported relationship types between MARS entries.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[cfg_attr(feature = "contracts", derive(schemars::JsonSchema, utoipa::ToSchema))]
#[serde(rename_all = "camelCase")]
pub enum RelationshipType {
/// The source entry depends on the target entry.
DependsOn,
/// The source entry composes (includes) the target entry.
Composes,
/// The source entry extends the target entry.
Extends,
/// The source entry replaces the target entry.
Replaces,
/// The source entry is an instance of the target entry.
InstanceOf,
/// The source entry is published by the target organization/human.
PublishedBy,
/// The source entry is related to the target entry (generic).
RelatedTo,
}Source line: 28.
Source provenance
Source: mars-protocol/src/relationships.rs · SHA-256 64bffdc5b8fae2a5b92f2550cba5950869643a9441aae965090b951df6d66475. Package overview.