Struct std::path::Display1.0.0[−][src]

pub struct Display<'a> { /* fields omitted */ }
Expand description

Helper 结构体,用于使用 format! 和 {} 安全地打印路径。

Path 可能包含非 Unicode 数据。 该 struct 可以减轻 Display trait 的负担。 它是通过 Path 上的 display 方法创建的。 根据平台的不同,这可能会执行有损转换。 如果您想要一个转义路径的实现,请改用 Debug。

Examples

use std::path::Path;

let path = Path::new("/tmp/foo.rs");

println!("{}", path.display());
Run

Trait Implementations

使用给定的格式化程序格式化该值。 Read more

使用给定的格式化程序格式化该值。 Read more

Auto Trait Implementations

Blanket Implementations

获取 self 的 TypeId。 Read more

从拥有的值中一成不变地借用。 Read more

从拥有的值中借用。 Read more

执行转换。

执行转换。

将给定值转换为 String。 Read more

发生转换错误时返回的类型。

执行转换。

发生转换错误时返回的类型。

执行转换。