pub struct Project {
pub project_types: Vec<ProjectType>,
pub path: PathBuf,
}Expand description
Fields§
§project_types: Vec<ProjectType>Every project type detected in path (at least one). Ordered by
ProjectType declaration order, de-duplicated.
path: PathBufThe project’s root directory.
Implementations§
Source§impl Project
impl Project
Sourcepub fn artifact_dirs(&self) -> Vec<&'static str>
pub fn artifact_dirs(&self) -> Vec<&'static str>
The de-duplicated union of artifact directories across all detected
project types in this directory (e.g. a Cargo+Node project yields both
target and node_modules).
Sourcepub fn size(&self, options: &ScanOptions) -> u64
pub fn size(&self, options: &ScanOptions) -> u64
Total size in bytes of this project’s artifact directories — the amount
clean would reclaim.
Sourcepub fn last_modified(&self, options: &ScanOptions) -> Result<SystemTime, Error>
pub fn last_modified(&self, options: &ScanOptions) -> Result<SystemTime, Error>
The most recent modification time across all entries in the project tree.
Sourcepub fn size_dirs(&self, options: &ScanOptions) -> ProjectSize
pub fn size_dirs(&self, options: &ScanOptions) -> ProjectSize
Per-top-level-entry disk usage for the project: total artifact bytes,
total non-artifact bytes, and a list of (name, size, is_artifact).
Sourcepub fn type_name(&self) -> String
pub fn type_name(&self) -> String
Human-readable project-type label(s), joined by " / " — e.g.
"Cargo" or "Cargo / Node".
Sourcepub fn clean(&self) -> Result<(), Box<dyn Error>>
pub fn clean(&self) -> Result<(), Box<dyn Error>>
Deletes the project’s artifact directories and their contents.
Every artifact directory is attempted even if an earlier one fails; the
first error (if any) is returned so callers — e.g. a TUI — can surface
it. Returns Ok(()) when all present artifact directories were removed.
Trait Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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