FileRelativePathBuf

Failed to generate docs for complex FileRelativePathBuf enum: b/332348955

A Utf8PathBuf which can be either file-relative, or has been resolved with the path to the containing file.

The 'serde::Deserialize' implementation results in these path being in the file-relative state.

The FileRelativePathBuf has 'From' implementations that create it in the "resolved" state when converting from path formats that are used by an application (str, String, Utf8Path, Utf8PathBuf, etc.)

use assembly_file_relative_path::FileRelativePathBuf;

let path: FileRelativePathBuf = "some/path/to/file_1.json".into(); assert_eq!( path, FileRelativePathBuf::Resolved("some/path/to/file_1.json".into()) );

let relative = path.make_relative_to_dir("some/path")?; assert_eq!( relative, FileRelativePathBuf::FileRelative("to/file_1.json".into()) );

Variant