MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / publication_proto

Function publication_proto

libatomic/src/daemon/sandbox_wire.rs:349–364  ·  view source on GitHub ↗
(
    publication: &SessionCheckpointPublication,
)

Source from the content-addressed store, hash-verified

347}
348
349pub fn publication_proto(
350 publication: &SessionCheckpointPublication,
351) -> Result<pb::ProvenancePublished, String> {
352 let published_at = publication.turn.timestamp_datetime().ok_or_else(|| {
353 "session publication timestamp is outside the supported range".to_string()
354 })?;
355 Ok(pb::ProvenancePublished {
356 provenance_hash: Some(hash_proto(&publication.turn.provenance_hash)),
357 published_at: Some(super::convert::timestamp_proto(published_at)),
358 manifest_hash: Some(hash_proto(&publication.manifest_hash)),
359 publication: Some(versioned(
360 PUBLICATION_SCHEMA,
361 serde_json::to_vec(publication).map_err(|e| e.to_string())?,
362 )),
363 })
364}
365
366pub fn publication_from(
367 published: &pb::ProvenancePublished,

Calls 4

versionedFunction · 0.85
hash_protoFunction · 0.70
timestamp_protoFunction · 0.70
timestamp_datetimeMethod · 0.45