pub struct ProjectScanner { /* private fields */ }Expand description
Rust项目扫描器
Implementations§
Source§impl ProjectScanner
impl ProjectScanner
Sourcepub fn new(config: ScanConfig) -> Self
pub fn new(config: ScanConfig) -> Self
创建新的扫描器
pub fn scan_with_cancel_and_progress<P: AsRef<Path>>( &self, root_path: P, cancel_flag: Option<&AtomicBool>, on_cargo_toml_found: Option<&(dyn Fn(usize) + Sync)>, ) -> Result<Vec<RustProject>>
Sourcepub fn scan_single<P: AsRef<Path>>(
&self,
project_path: P,
) -> Result<RustProject>
pub fn scan_single<P: AsRef<Path>>( &self, project_path: P, ) -> Result<RustProject>
扫描单个项目(用于验证特定路径)
Sourcepub fn filter_with_target(projects: Vec<RustProject>) -> Vec<RustProject>
pub fn filter_with_target(projects: Vec<RustProject>) -> Vec<RustProject>
过滤有target目录的项目
Sourcepub fn sort_by_size(projects: Vec<RustProject>) -> Vec<RustProject>
pub fn sort_by_size(projects: Vec<RustProject>) -> Vec<RustProject>
按大小排序项目(从大到小)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProjectScanner
impl RefUnwindSafe for ProjectScanner
impl Send for ProjectScanner
impl Sync for ProjectScanner
impl Unpin for ProjectScanner
impl UnsafeUnpin for ProjectScanner
impl UnwindSafe for ProjectScanner
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