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

Method to_canonical_bytes

atomic-objects/src/view_snapshot.rs:109–111  ·  view source on GitHub ↗

Serialize to canonical JSON bytes. Deterministic: struct field order is fixed and every field is deterministic, so the byte output — and thus the content key — is stable across client and server.

(&self)

Source from the content-addressed store, hash-verified

107 /// fixed and every field is deterministic, so the byte output — and thus the
108 /// content key — is stable across client and server.
109 pub fn to_canonical_bytes(&self) -> Vec<u8> {
110 serde_json::to_vec(self).expect("ViewSnapshot serializes")
111 }
112
113 /// The content address (hex Blake3) of the canonical bytes — this object's
114 /// key in the object store and the value a `views/{name}` ref points at.

Calls

no outgoing calls