std.fs.DirectoryEntry
class pub DirectoryEntry
An entry in a directory.
Instances of this type are typically produced by std.fs.path.Path.list
,
so see that method's documentation for additional details.
Fields
path
let pub @path: Path
The path to the entry.
type
let pub @type: FileType
The type of this entry.
Instance methods
!=
Show source codeHide source code
fn pub !=(other: T) -> Bool {
(self == other).false?
}
fn pub !=(other: T) -> Bool
Returns true
if self
and the given object are not equal to each other.
==
Show source codeHide source code
fn pub ==(other: ref DirectoryEntry) -> Bool {
@path == other.path and @type == other.type
}
fn pub ==(other: ref DirectoryEntry) -> Bool
Returns true
if self
and the given object are equal to each other.
This operator is used to perform structural equality. This means two objects residing in different memory locations may be considered equal, provided their structure is equal. For example, two different arrays may be considered to have structural equality if they contain the exact same values.
fmt
Show source codeHide source code
fn pub fmt(formatter: mut Formatter) {
formatter
.object('DirectoryEntry')
.field('path', @path)
.field('type', @type)
.finish
}
fn pub fmt(formatter: mut Formatter)
Formats self
in a human-readable format for debugging purposes.
Implemented traits
Equal
impl Equal[ref DirectoryEntry] for DirectoryEntry
Format
impl Format for DirectoryEntry