pub struct ProjectCleaner { /* private fields */ }Expand description
项目清理器
Implementations§
Source§impl ProjectCleaner
impl ProjectCleaner
Sourcepub fn new(config: CleanConfig) -> Self
pub fn new(config: CleanConfig) -> Self
创建新的清理器
Sourcepub fn clean_project(&self, project: &RustProject) -> Result<u64>
pub fn clean_project(&self, project: &RustProject) -> Result<u64>
清理单个项目
Sourcepub fn clean_project_with_progress<F>(
&self,
project: &RustProject,
progress_callback: F,
) -> Result<u64>where
F: Fn(CleanProgress),
pub fn clean_project_with_progress<F>(
&self,
project: &RustProject,
progress_callback: F,
) -> Result<u64>where
F: Fn(CleanProgress),
清理单个项目(带进度回调)
pub fn clean_project_with_progress_and_cancel<F>(
&self,
project: &RustProject,
cancel_flag: Option<&AtomicBool>,
progress_callback: F,
) -> Result<u64>where
F: Fn(CleanProgress),
Sourcepub fn clean_projects(&self, projects: &[RustProject]) -> CleanResult
pub fn clean_projects(&self, projects: &[RustProject]) -> CleanResult
批量清理项目
Sourcepub fn preview_clean(&self, projects: &[RustProject]) -> CleanResult
pub fn preview_clean(&self, projects: &[RustProject]) -> CleanResult
预览清理操作(dry run)
Sourcepub fn check_cargo_available() -> bool
pub fn check_cargo_available() -> bool
检查cargo命令是否可用
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProjectCleaner
impl RefUnwindSafe for ProjectCleaner
impl Send for ProjectCleaner
impl Sync for ProjectCleaner
impl Unpin for ProjectCleaner
impl UnsafeUnpin for ProjectCleaner
impl UnwindSafe for ProjectCleaner
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> 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