nml 0.2.0

A parser and Serde implementation for the Fortran Namelist format
Documentation
  • Coverage
  • 19.35%
    6 out of 31 items documented3 out of 3 items with examples
  • Size
  • Source code size: 83.6 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.1 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 15s Average build duration of successful builds.
  • all releases: 15s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • manorom/nml
    0 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • manorom

nml

Serialize and deserialize Fortran namelist input in Rust using the serde framework.

Usage

use serde::Deserialize;

#[derive(Deserialize, Debug)]
struct Particle {
    index: i32,
    position: [f32; 3],
    velocity: [f32; 3]
}

fn main() -> Result<(), nml::NamelistError>{
    let s = r#"
      &particle
       index = 0,
       position = 0.0, 0.0, 0.0,
       velocity = 1.0, 0.0, 0.0,
      /"#;

  let particle: Particle = nml::group_from_str(s)?.1;
  println!("{:#?}", particle);

  Ok(())
}