pub struct File<'a> {
pub path: Cow<'a, str>,
pub meta: Option<FileMetadata<'a>>,
}
Expand description
The file path and any additional info of either the old file or the new file
Fields§
§path: Cow<'a, str>
The parsed path or file name of the file
Avoids allocation if at all possible. Only allocates if the file path is a quoted string literal. String literals are necessary in some cases, for example if the file path has spaces in it. These literals can contain escaped characters which are initially seen as groups of two characters by the parser (e.g. ‘\’ + ‘n’). A newly allocated string is used to unescape those characters (e.g. “\n” -> ‘\n’).
Note: While this string is typically a file path, this library makes no attempt to verify the format of that path. That means that this field can potentially be any string. You should verify it before doing anything that may be security-critical.
meta: Option<FileMetadata<'a>>
Any additional information provided with the file path