Cargo tests and formatting security audit

struct-path for Rust

Library provides a tiny macro implementation to reference Rust struct fields at compile time to represent its string format. This is needed to work with JSON paths, and some others protocols when we still want to rely on the compiler to avoid inconsistent changes.

Features: - Fast and no macro parsing without huge deps; - Macro produces the code to verify if the specified path really exists; - Multiple fields/arrays support - Optional camelCase and PascalCase conversion support; - Optional delimiter parameter;

Quick start

Cargo.toml: toml [dependencies] struct-path = "0.1"

Example code: ```rust

use struct_path::*;

pub struct TestStructParent { pub valuestr: String, pub valuenum: u64, pub value_child: TestStructChild, }

pub struct TestStructChild { pub childvaluestr: String, pub childvaluenum: u64, }

// returns "valuestr" let s1: &str = path!(TestStructParent::valuestr);

// returns "valuechild.childvaluestr" let s2: &str = path!(TestStructParent::valuechild.childvaluestr) ;

// returns also "valuechild.childvaluestr" let s3: &str = path!(TestStructParent::valuechild,TestStructChild::childvaluestr);

// options, returns "valueChild/childValueStr" let s4: &str = path!(TestStructParent::valuechild.childvalue_str; delim="/", case="camel") ;

// returns ["valuestr", "valuenum"] let arr: [&str; 2] = paths!(TestStructParent::{ valuestr, valuenum });

```

Licence

Apache Software License (ASL)

Author

Abdulla Abdurakhmanov