ifc_classification/library/
information.rs1use crate::view::{
3 borrowed_entity, optional_ref, optional_text, required_text, ClassificationView,
4};
5use crate::ClassificationResult;
6borrowed_entity!(LibraryInformation, "IFCLIBRARYINFORMATION");
7impl<'m> LibraryInformation<'m> {
8 pub fn name(self) -> ClassificationResult<&'m str> {
10 required_text(
11 "IFCLIBRARYINFORMATION",
12 self.id(),
13 self.entity(),
14 self.text_slot("Name")?,
15 "Name",
16 )
17 }
18 pub fn version(self) -> ClassificationResult<Option<&'m str>> {
20 optional_text(
21 "IFCLIBRARYINFORMATION",
22 self.id(),
23 self.entity(),
24 self.text_slot("Version")?,
25 "Version",
26 )
27 }
28 pub fn publisher_id(self) -> ClassificationResult<Option<ifc_model::EntityId>> {
30 optional_ref(
31 "IFCLIBRARYINFORMATION",
32 self.id(),
33 self.entity(),
34 self.slot("Publisher")?,
35 "Publisher",
36 )
37 }
38 pub fn version_date(self) -> ClassificationResult<Option<&'m str>> {
40 optional_text(
41 "IFCLIBRARYINFORMATION",
42 self.id(),
43 self.entity(),
44 self.text_slot("VersionDate")?,
45 "VersionDate",
46 )
47 }
48 pub fn location(self) -> ClassificationResult<Option<&'m str>> {
50 optional_text(
51 "IFCLIBRARYINFORMATION",
52 self.id(),
53 self.entity(),
54 self.text_slot("Location")?,
55 "Location",
56 )
57 }
58 pub fn description(self) -> ClassificationResult<Option<&'m str>> {
60 optional_text(
61 "IFCLIBRARYINFORMATION",
62 self.id(),
63 self.entity(),
64 self.text_slot("Description")?,
65 "Description",
66 )
67 }
68}
69impl<'m> ClassificationView<'m> {
70 pub fn libraries(self) -> impl Iterator<Item = LibraryInformation<'m>> + 'm {
72 self.model()
73 .of_type("IFCLIBRARYINFORMATION")
74 .map(move |(id, e)| LibraryInformation::from_known(id, e, self.release()))
75 }
76}