pub trait RelativePath {
// Required method
fn relative_to(&self, source: &Path) -> PathBuf;
// Provided method
fn relative_to_cwd(&self) -> PathBuf { ... }
}Expand description
Extension trait to get the relative path.
Required Methods§
Sourcefn relative_to(&self, source: &Path) -> PathBuf
fn relative_to(&self, source: &Path) -> PathBuf
Returns the path to navigate from a source path to self.
Provided Methods§
Sourcefn relative_to_cwd(&self) -> PathBuf
fn relative_to_cwd(&self) -> PathBuf
Returns the path to navigate from the current directory to self.