om2

Crates.ioom2
lib.rsom2
version0.1.9
sourcesrc
created_at2020-05-04 15:56:04.418644
updated_at2020-09-21 04:14:37.1929
descriptionA set of classes generated from the OM2 RDF schema (mainly Unit)
homepagehttps://gitlab.com/orthecreedence/om2
repositoryhttps://gitlab.com/orthecreedence/om2
max_upload_size
id237422
size969,685
andrew lyon (orthecreedence)

documentation

https://docs.rs/om2/

README

OM2

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));
Commit count: 16

cargo fmt