{"id":17700516,"url":"https://github.com/cdown/filestruct","last_synced_at":"2026-03-13T14:03:55.050Z","repository":{"id":153925541,"uuid":"631124517","full_name":"cdown/filestruct","owner":"cdown","description":"Derive macro to read from a directory into a Rust struct.","archived":false,"fork":false,"pushed_at":"2024-11-08T06:17:06.000Z","size":36,"stargazers_count":2,"open_issues_count":10,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-13T01:05:12.584Z","etag":null,"topics":["derive-macro","files","filesystem","proc-macro","rust","rust-lang","struct"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cdown.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-04-22T02:28:11.000Z","updated_at":"2024-11-08T06:17:04.000Z","dependencies_parsed_at":"2023-07-11T06:45:36.420Z","dependency_job_id":"0119a9af-2088-4aab-8e8a-718f2f593f52","html_url":"https://github.com/cdown/filestruct","commit_stats":null,"previous_names":["cdown/structfromdir"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdown%2Ffilestruct","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdown%2Ffilestruct/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdown%2Ffilestruct/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdown%2Ffilestruct/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdown","download_url":"https://codeload.github.com/cdown/filestruct/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253850874,"owners_count":21973672,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["derive-macro","files","filesystem","proc-macro","rust","rust-lang","struct"],"created_at":"2024-10-24T17:42:26.313Z","updated_at":"2026-03-13T14:03:55.011Z","avatar_url":"https://github.com/cdown.png","language":"Rust","readme":"# filestruct | [![Tests](https://img.shields.io/github/actions/workflow/status/cdown/filestruct/ci.yml?branch=master)](https://github.com/cdown/filestruct/actions?query=branch%3Amaster)\n\nA Rust derive macro which permits reading struct values from a directory.\n\nNot ready for production use, still in heavy development and many things are\nnot yet implemented or will unexpectedly blow up.\n\n## Usage\n\n```rust\nuse filestruct::FromDir;\n\n#[derive(FromDir, Debug)]\nstruct Files {\n    comm: String,\n    #[filestruct(file = \"comm\", trim = true)]\n    comm_trimmed: String,\n    oom_score: u32,\n    does_not_exist: Option\u003cu32\u003e,\n    #[filestruct(file = \"oom_score_adj\")]\n    does_not_exist_but_renamed: Option\u003cu32\u003e,\n    #[filestruct(relative_dir = \"..\", trim = true)]\n    uptime: String,\n}\n\nfn main() {\n    let files = Files::from_dir(\"/proc/self\");\n    println!(\"{:#?}\", files);\n}\n```\n\nResults in:\n\n```rust\nOk(\n    Files {\n        comm: \"pdm-bin\\n\",\n        comm_trimmed: \"pdm-bin\",\n        oom_score: 800,\n        does_not_exist: None,\n        does_not_exist_but_renamed: Some(\n            200,\n        ),\n        uptime: \"177405.74 822813.82\",\n    },\n)\n```\n\n## Releases\n\nReleases are a little complicated because filestruct_derive and filestruct are\nseparate crates. Use `cargo release`:\n\n```\ncargo release --execute -- minor\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdown%2Ffilestruct","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdown%2Ffilestruct","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdown%2Ffilestruct/lists"}