shapes_converter/shex_to_html/
entry.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use serde::Serialize;

use super::{Cardinality, Name, ValueConstraint};

/// Represents a Shape entry. This value is the one that is referenced from the templates
#[derive(Serialize, Debug, PartialEq, Clone)]
pub struct ShapeTemplateEntry {
    pub name: Name,
    pub value_constraint: ValueConstraint,
    pub card: Cardinality,
}

impl ShapeTemplateEntry {
    pub fn new(
        name: Name,
        value_constraint: ValueConstraint,
        card: Cardinality,
    ) -> ShapeTemplateEntry {
        ShapeTemplateEntry {
            name,
            value_constraint,
            card,
        }
    }
}