pub struct Artifact {
pub path: PathBuf,
pub kind: ArtifactKind,
pub size: u64,
pub file_count: u64,
pub age: Option<Duration>,
pub metadata: ArtifactMetadata,
}Expand description
A cleanable artifact within a project
Fieldsยง
ยงpath: PathBufFull path to the artifact
kind: ArtifactKindType of artifact
size: u64Size in bytes
file_count: u64Number of files contained
age: Option<Duration>Age since last modification
metadata: ArtifactMetadataAdditional metadata
Implementationsยง
Sourceยงimpl Artifact
impl Artifact
Sourcepub fn new(path: PathBuf, kind: ArtifactKind) -> Self
pub fn new(path: PathBuf, kind: ArtifactKind) -> Self
Create a new artifact
Sourcepub fn is_safe_to_clean(&self) -> bool
pub fn is_safe_to_clean(&self) -> bool
Check if this artifact can be safely deleted based on its kind
Sourcepub fn size_display(&self) -> String
pub fn size_display(&self) -> String
Get a human-readable size string
Trait Implementationsยง
Sourceยงimpl<'de> Deserialize<'de> for Artifact
impl<'de> Deserialize<'de> for Artifact
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 Artifact
impl RefUnwindSafe for Artifact
impl Send for Artifact
impl Sync for Artifact
impl Unpin for Artifact
impl UnwindSafe for Artifact
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,
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 moreSourceยงimpl<T> Pointable for T
impl<T> Pointable for T
Sourceยงimpl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Sourceยงfn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more