sysml_core/
relationship.rs1use nomograph_core::traits::Relationship;
2use nomograph_core::types::Span;
3use serde::{Deserialize, Serialize};
4use std::path::{Path, PathBuf};
5
6#[derive(Debug, Clone, Serialize, Deserialize)]
7pub struct SysmlRelationship {
8 pub source: String,
9 pub target: String,
10 pub kind: String,
11 pub file_path: PathBuf,
12 pub span: Span,
13}
14
15impl Relationship for SysmlRelationship {
16 fn source(&self) -> &str {
17 &self.source
18 }
19
20 fn target(&self) -> &str {
21 &self.target
22 }
23
24 fn kind(&self) -> &str {
25 &self.kind
26 }
27
28 fn file_path(&self) -> &Path {
29 &self.file_path
30 }
31
32 fn span(&self) -> Span {
33 self.span.clone()
34 }
35}