pub trait Location: Sized + Send + Sync {
// Required methods
fn apex() -> Self;
fn as_path(&self) -> &PathBuf;
// Provided method
fn display(&self) -> String { ... }
}
Expand description
A location of file or directory of a project.
It must be implemented by application since it is project specific. See example implementation in the repository.
Required Methods§
sourcefn apex() -> Self
fn apex() -> Self
Returns a location of the root directory of a project.
It’d be better to call it root
but this name left vacant because it’s used often
and it’s annoying bringing this trait into a scope everytime Loc::root()
needs to be called. This way, users can have root
on their implementation and call it
by just importing their type.