shacl_ir/components/
xone.rs1use crate::shape_label_idx::ShapeLabelIdx;
2use std::fmt::Display;
3
4#[derive(Debug, Clone)]
10pub struct Xone {
11 shapes: Vec<ShapeLabelIdx>,
12}
13
14impl Xone {
15 pub fn new(shapes: Vec<ShapeLabelIdx>) -> Self {
16 Xone { shapes }
17 }
18
19 pub fn shapes(&self) -> &Vec<ShapeLabelIdx> {
20 &self.shapes
21 }
22}
23
24impl Display for Xone {
25 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
26 write!(
27 f,
28 "Xone [{}]",
29 self.shapes()
30 .iter()
31 .map(|s| s.to_string())
32 .collect::<Vec<_>>()
33 .join(", ")
34 )
35 }
36}