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

Function encode

atomic-repository/src/repository/remote_cache.rs:81–83  ·  view source on GitHub ↗
(value: &T)

Source from the content-addressed store, hash-verified

79pub const SANDBOX_GRAPH_SLICE_SCHEMA: &str = "atomic.sandbox.graph-slice.v1";
80
81fn encode<T: Serialize>(value: &T) -> Result<Vec<u8>, RepositoryError> {
82 postcard::to_allocvec(value).map_err(|e| RepositoryError::Serialization(e.to_string()))
83}
84
85fn decode<'a, T: Deserialize<'a>>(bytes: &'a [u8]) -> Result<T, RepositoryError> {
86 postcard::from_bytes(bytes).map_err(|e| RepositoryError::Serialization(e.to_string()))

Callers 5

to_bytesMethod · 0.70
rows_to_bytesMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected