pub struct RustProject {
pub path: PathBuf,
pub name: String,
pub target_size: u64,
pub last_modified: SystemTime,
pub is_workspace: bool,
pub has_target: bool,
}Expand description
Rust project metadata
Fields§
§path: PathBuf§name: String§target_size: u64§last_modified: SystemTime§is_workspace: bool§has_target: boolImplementations§
Source§impl RustProject
impl RustProject
Sourcepub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self>
Create a RustProject from a directory path
Sourcepub fn from_path_lazy<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn from_path_lazy<P: AsRef<Path>>(path: P) -> Result<Self>
Create a RustProject from a directory path, without computing target size
Sourcepub fn formatted_size(&self) -> String
pub fn formatted_size(&self) -> String
Get a human-readable target size string
Sourcepub fn get_target_size(&self) -> u64
pub fn get_target_size(&self) -> u64
Get target directory size (compute on demand if needed)
Sourcepub fn relative_path(&self, base: &Path) -> PathBuf
pub fn relative_path(&self, base: &Path) -> PathBuf
Get relative path from a base directory
Sourcepub fn target_exists(&self) -> bool
pub fn target_exists(&self) -> bool
Check if target directory exists
Sourcepub fn target_path(&self) -> PathBuf
pub fn target_path(&self) -> PathBuf
Get target directory path
Trait Implementations§
Source§impl Clone for RustProject
impl Clone for RustProject
Source§fn clone(&self) -> RustProject
fn clone(&self) -> RustProject
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RustProject
impl Debug for RustProject
Source§impl<'de> Deserialize<'de> for RustProject
impl<'de> Deserialize<'de> for RustProject
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RustProject
impl RefUnwindSafe for RustProject
impl Send for RustProject
impl Sync for RustProject
impl Unpin for RustProject
impl UnsafeUnpin for RustProject
impl UnwindSafe for RustProject
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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