codegraph_parser_api/relationships/
inheritance.rs1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
5pub struct InheritanceRelation {
6 pub child: String,
8
9 pub parent: String,
11
12 pub order: usize,
14}
15
16impl InheritanceRelation {
17 pub fn new(child: impl Into<String>, parent: impl Into<String>) -> Self {
18 Self {
19 child: child.into(),
20 parent: parent.into(),
21 order: 0,
22 }
23 }
24
25 pub fn with_order(mut self, order: usize) -> Self {
26 self.order = order;
27 self
28 }
29}