keynotes 0.1.0

Keynotes is a command line note keeping app using the keydata library. Notes are stored as key-value pairs organized into named sections.
Documentation
  • Coverage
  • 100%
    16 out of 16 items documented11 out of 12 items with examples
  • Size
  • Source code size: 37.48 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.05 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 12s Average build duration of successful builds.
  • all releases: 12s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Andrew-OHara/keynotes
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Andrew-OHara

keydata

A small library for storing string data in simple data files. Useful for config files. Data is stored as key-value pairs organized into sections and saved with a simple custom format. Files are saved in .keynotes folder in the users home folder

version

0.1.0

usage

fn main() -> Result<(), Box<dyn Error>> {
    let mut file = keydata::KeynoteFile::new("kntest.dat")?;    // saved in hidden folder in users home dir   
    file.load_data()?;
    file.add_section("sectionname")?;
    file.add_entry("sectionname", "somekey", "somevalue")?;
    
    // list all the keys in the file
    for (_, section) in file.get_sections() {   
        if section.data.len() != 0 {
           println!("{}", section.name)
        }    
      
        for (k, _) in section.data.iter() {
            println!("\t{}", k);
        }
    }    

    fs::remove_file(file.filepath);  // remove the test file
     
    Ok(()) 
}

For a more complete example featuring a full command line app go to: https://github.com/Andrew-OHara/keynotes/blob/master/src/main.rs

License

MIT