1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use crate::{
	lexical::{self, LexicalFormOf},
	Datatype, ParseRdf, XsdDatatype,
};

pub type Boolean = bool;

impl XsdDatatype for Boolean {
	fn type_(&self) -> Datatype {
		Datatype::Boolean
	}
}

impl LexicalFormOf<Boolean> for lexical::Boolean {
	type ValueError = std::convert::Infallible;

	fn try_as_value(&self) -> Result<Boolean, Self::ValueError> {
		Ok(self.value())
	}
}

impl ParseRdf for Boolean {
	type LexicalForm = lexical::Boolean;
}