use-material-property 0.0.1

Lightweight material-property metadata helpers
Documentation
  • Coverage
  • 5%
    1 out of 20 items documented1 out of 10 items with examples
  • Size
  • Source code size: 6.08 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 445.42 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 8s Average build duration of successful builds.
  • all releases: 8s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-materials
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

Lightweight material-property metadata helpers.

This crate intentionally stays small. It models a property kind, a numeric value, and a display unit without becoming a full material database.

Examples

use use_material_property::{
    MaterialProperty, MaterialPropertyKind, filter_by_kind, property_values,
};

let properties = [
    MaterialProperty::new(MaterialPropertyKind::Density, 7_850.0, "kg/m^3").unwrap(),
    MaterialProperty::new(MaterialPropertyKind::Stress, 250_000_000.0, "Pa").unwrap(),
    MaterialProperty::new(MaterialPropertyKind::Density, 1_000.0, "kg/m^3").unwrap(),
];

assert_eq!(filter_by_kind(&properties, MaterialPropertyKind::Density).len(), 2);
assert_eq!(property_values(&properties, MaterialPropertyKind::Density), vec![7_850.0, 1_000.0]);