pub enum IdsVersion {
Draft0_9,
Draft0_9_6,
Draft0_9_7,
Ids1_0,
}Expand description
A published IDS schema version.
Ordered oldest to newest; Ids1_0 is the only approved standard.
Variants§
Draft0_9
0.9 and earlier pre-release drafts.
Draft0_9_6
0.9.6.
Draft0_9_7
0.9.7.
Ids1_0
1.0 — the approved buildingSMART standard.
Implementations§
Source§impl IdsVersion
impl IdsVersion
Sourcepub const CURRENT: IdsVersion = IdsVersion::Ids1_0
pub const CURRENT: IdsVersion = IdsVersion::Ids1_0
The version new documents should be written as.
Writing anything older is a deliberate compatibility choice, never a default.
Sourcepub const ALL: [IdsVersion; 4]
pub const ALL: [IdsVersion; 4]
Every published version, oldest first.
Exposed so callers — and the tests here — can iterate versions without hand-listing variants and silently omitting a newly added one.
use openbim_ids::IdsVersion;
assert!(IdsVersion::ALL.contains(&IdsVersion::CURRENT));Sourcepub fn is_approved(self) -> bool
pub fn is_approved(self) -> bool
Whether this version is an approved standard rather than a draft.
Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
The canonical release string, as it appears in the schema location path.
IDS schemas are published under
http://standards.buildingsmart.org/IDS/<version>/ids.xsd, so these are
the forms that actually occur in an xsi:schemaLocation hint.
use openbim_ids::IdsVersion;
assert_eq!(IdsVersion::Ids1_0.as_str(), "1.0");Trait Implementations§
Source§impl Clone for IdsVersion
impl Clone for IdsVersion
impl Copy for IdsVersion
Source§impl Debug for IdsVersion
impl Debug for IdsVersion
Source§impl Display for IdsVersion
impl Display for IdsVersion
impl Eq for IdsVersion
Source§impl FromStr for IdsVersion
impl FromStr for IdsVersion
Source§fn from_str(s: &str) -> Result<Self, Self::Err>
fn from_str(s: &str) -> Result<Self, Self::Err>
Parses a published IDS version string.
Accepts the canonical release forms produced by IdsVersion::as_str,
and additionally the three-component spellings that the schema files
themselves carry in their own @version attribute — ids.xsd for the
approved standard declares version="1.0.0", not "1.0". Rejecting
that spelling would mean a version read straight out of a schema failed
to parse.
use openbim_ids::IdsVersion;
assert_eq!("1.0".parse(), Ok(IdsVersion::Ids1_0));
assert_eq!("1.0.0".parse(), Ok(IdsVersion::Ids1_0));
assert!("0.8".parse::<IdsVersion>().is_err());