path

Macro path 

Source
path!() { /* proc-macro */ }
Expand description

Generate a new type for a path

The path! macro generates a new type that is backed by a PathBuf. The new type implements common traits like Display and From<&Path>. The inner value can be accessed using the get method.

ยงExamples

use std::path::PathBuf;
use typed_fields::path;

path!(MyPath);

let path = MyPath::new(PathBuf::from("src"));
println!("My path: {}", path);