Crates.io | om2 |
lib.rs | om2 |
version | 0.1.9 |
source | src |
created_at | 2020-05-04 15:56:04.418644 |
updated_at | 2020-09-21 04:14:37.1929 |
description | A set of classes generated from the OM2 RDF schema (mainly Unit) |
homepage | https://gitlab.com/orthecreedence/om2 |
repository | https://gitlab.com/orthecreedence/om2 |
max_upload_size | |
id | 237422 |
size | 969,685 |
This crate is a loose attempt at creating a Unit
struct based off of the units
available in the OM2 ontology. It also exports Measure
and NumericUnion
classes.
All structs/enums exported are (de)serializable via Serde.
use om2::{Unit, Measure, NumericUnion};
let measure = Measure::builder()
.has_unit(Unit::Hour)
.has_numerical_value(NumericUnion::Integer(7))
.build().unwrap();
assert_eq!(measure.has_unit(), &Unit::Hour);
assert_eq!(measure.has_numerical_value(), &NumericUnion::Integer(7));