shapes_converter/shex_to_html/
entry.rs

1use serde::Serialize;
2
3use super::{Cardinality, Name, ValueConstraint};
4
5/// Represents a Shape entry. This value is the one that is referenced from the templates
6#[derive(Serialize, Debug, PartialEq, Clone)]
7pub struct ShapeTemplateEntry {
8    pub name: Name,
9    pub value_constraint: ValueConstraint,
10    pub card: Cardinality,
11}
12
13impl ShapeTemplateEntry {
14    pub fn new(
15        name: Name,
16        value_constraint: ValueConstraint,
17        card: Cardinality,
18    ) -> ShapeTemplateEntry {
19        ShapeTemplateEntry {
20            name,
21            value_constraint,
22            card,
23        }
24    }
25}