| Crates.io | path_ratchet |
| lib.rs | path_ratchet |
| version | 0.3.2 |
| created_at | 2023-12-04 16:38:16.302383+00 |
| updated_at | 2025-09-16 18:19:14.82409+00 |
| description | Prevent path traversal attacks at type level |
| homepage | |
| repository | https://github.com/TheAlgorythm/path-ratchet |
| max_upload_size | |
| id | 1057789 |
| size | 40,851 |
Path RatchetPrevent path traversal attacks at type level.
use std::path::PathBuf;
use path_ratchet::prelude::*;
let user_input = "/etc/shadow";
let mut filename = PathBuf::from("/tmp");
filename.push_component(SingleComponentPath::new(user_input).unwrap());