pub struct ProjectFinder { /* private fields */ }Expand description
Finds a sub project.
§Project Resolution
From a given base project, a path is resolved as follows:
- an empty path (
"") refers to the base project. - a path starting with a
":"searches starting from therootproject. - A path starting with
:<root project name>is equivalent to just":". - each component after that, which are seperated by a
":", is a child of the current search
For example, in this given structure with a search starting pointed marked with <--,
root:
- child1: <--
- child2:
- child3:To access child2, you can either use child2, :child1:child2, or :root:child1:child2.
Meanwhile, child3 can only be accessed via :child3, or :root:child3.
Implementations§
Source§impl ProjectFinder
impl ProjectFinder
Sourcepub fn new(project: &SharedProject) -> Self
pub fn new(project: &SharedProject) -> Self
Creates a new project finder
Sourcepub fn find<S: AsRef<ProjectPath>>(&self, id: S) -> Option<SharedProject>
pub fn find<S: AsRef<ProjectPath>>(&self, id: S) -> Option<SharedProject>
Tries to find a project relative to this one from a project id.
For more info on how finding works, check out the definition of the ProjectFinder
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProjectFinder
impl !RefUnwindSafe for ProjectFinder
impl Send for ProjectFinder
impl Sync for ProjectFinder
impl Unpin for ProjectFinder
impl !UnwindSafe for ProjectFinder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> InstanceOf for T
impl<T> InstanceOf for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more