MCPcopy Create free account
hub / github.com/dfinity/orbit / from

Method from

core/control-panel/impl/src/mappers/artifact.rs:6–14  ·  view source on GitHub ↗
(model: Artifact)

Source from the content-addressed store, hash-verified

4
5impl From<Artifact> for control_panel_api::ArtifactDTO {
6 fn from(model: Artifact) -> Self {
7 control_panel_api::ArtifactDTO {
8 id: Uuid::from_bytes(*model.id()).to_string(),
9 size: model.artifact().len() as u64,
10 hash: hex::encode(model.hash()),
11 artifact: model.artifact().to_vec(),
12 created_at: timestamp_to_rfc3339(&model.created_at()),
13 }
14 }
15}
16
17#[cfg(test)]

Callers

nothing calls this directly

Calls 7

timestamp_to_rfc3339Function · 0.85
idMethod · 0.80
artifactMethod · 0.80
to_vecMethod · 0.80
created_atMethod · 0.80
lenMethod · 0.45
hashMethod · 0.45

Tested by

no test coverage detected