#[non_exhaustive]pub struct Project {
pub root: PathBuf,
pub config: Config,
}Expand description
A project: its root and what its shuyi.ron says. Build it with
Project::new or Project::load (ADR-0039).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.root: PathBufThe folder holding shuyi.ron.
config: ConfigWhat it says.
Implementations§
Source§impl Project
impl Project
Sourcepub fn new(root: impl Into<PathBuf>, config: Config) -> Self
pub fn new(root: impl Into<PathBuf>, config: Config) -> Self
The project at root whose shuyi.ron says config.
Sourcepub fn find(start: &Path) -> Result<Self, (Code, String)>
pub fn find(start: &Path) -> Result<Self, (Code, String)>
The project of the first folder from start up that holds a
shuyi.ron, or the problem code and the message why there is
none: no file (codes::NO_PROJECT), or one that doesn’t read
(codes::PROJECT_FILE).
Trait Implementations§
impl StructuralPartialEq for Project
Auto Trait Implementations§
impl Freeze for Project
impl RefUnwindSafe for Project
impl Send for Project
impl Sync for Project
impl Unpin for Project
impl UnsafeUnpin for Project
impl UnwindSafe for Project
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