| Crates.io | pathmod_derive |
| lib.rs | pathmod_derive |
| version | 0.1.3 |
| created_at | 2025-09-02 12:15:13.107809+00 |
| updated_at | 2025-09-02 13:31:38.919409+00 |
| description | Derive macros for pathmod |
| homepage | https://github.com/dahankzter/pathmod-rs |
| repository | https://github.com/dahankzter/pathmod-rs |
| max_upload_size | |
| id | 1821052 |
| size | 30,743 |
Purpose
#[derive(Accessor)] for structs (named and tuple).pub const accessor methods for each field:
acc_<field>() -> pathmod::Accessor<Self, FieldTy>acc_<idx>() -> pathmod::Accessor<Self, FieldTy>Behavior
core::mem::offset_of!, enabling const construction.How to use
pathmod and use pathmod::prelude::*; which re-exports this derive.use pathmod_derive::Accessor; then annotate your types.Example See top-level README for end-to-end examples. Minimal snippet:
use pathmod::prelude::*;
#[derive(Accessor)]
struct Address { city: String }
fn example() {
let _acc = Address::acc_city();
}
Limitations and diagnostics
pub, private types/field types aren’t accessible from outside their module.trybuild cover error messages and generics visibility cases.MSRV
core::mem::offset_of!).License Dual-licensed under MIT or Apache-2.0.