pub struct Artifact { /* private fields */ }Expand description
Cached task artifact containing outputs and metadata.
Artifacts are immutable once created and contain:
- Metadata (task info, timestamps, cache key hash)
- Manifest (list of output files with hashes)
- Compressed output files
Implementations§
Source§impl Artifact
impl Artifact
Sourcepub fn new(
package_name: String,
task_name: String,
command: String,
cache_key_hash: String,
output_files: BTreeMap<PathBuf, Vec<u8>>,
) -> Result<Self>
pub fn new( package_name: String, task_name: String, command: String, cache_key_hash: String, output_files: BTreeMap<PathBuf, Vec<u8>>, ) -> Result<Self>
Creates a new artifact from task outputs.
§Arguments
package_name- Name of the packagetask_name- Name of the taskcommand- Command that was executedcache_key_hash- Hash of the cache keyoutput_files- Map of relative paths to file contents
§Errors
Returns an error if compression or serialization fails.
Sourcepub fn from_compressed(data: Vec<u8>) -> Result<Self>
pub fn from_compressed(data: Vec<u8>) -> Result<Self>
Reads an artifact from compressed data.
§Errors
Returns an error if decompression, deserialization, or verification fails.
Sourcepub fn compressed_data(&self) -> &[u8] ⓘ
pub fn compressed_data(&self) -> &[u8] ⓘ
Returns the compressed artifact data.
Trait Implementations§
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> 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