pub struct Display<'a> { /* fields omitted */ }
Expand description
Helper 结构体,用于使用 format!
和 {}
安全地打印路径。
Path
可能包含非 Unicode 数据。
该 struct
可以减轻 Display
trait 的负担。
它是通过 Path
上的 display
方法创建的。
根据平台的不同,这可能会执行有损转换。
如果您想要一个转义路径的实现,请改用 Debug
。
use std::path::Path;
let path = Path::new("/tmp/foo.rs");
println!("{}", path.display());
Run
impl<T> Any for T where
T: 'static + ?Sized,
impl<T, U> Into<U> for T where
U: From<T>,