Skip to main content

shacl_ir/components/
max_inclusive.rs

1use rudof_rdf::rdf_core::term::literal::ConcreteLiteral;
2use std::fmt::Display;
3
4/// https://www.w3.org/TR/shacl/#MaxInclusiveConstraintComponent
5#[derive(Debug, Clone)]
6pub struct MaxInclusive {
7    max_inclusive: ConcreteLiteral,
8}
9
10impl MaxInclusive {
11    pub fn new(literal: ConcreteLiteral) -> Self {
12        MaxInclusive { max_inclusive: literal }
13    }
14
15    pub fn max_inclusive(&self) -> &ConcreteLiteral {
16        &self.max_inclusive
17    }
18}
19
20impl Display for MaxInclusive {
21    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
22        write!(f, "MaxInclusive: {}", self.max_inclusive())
23    }
24}