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

Function encode_layout

atomic-core/src/change/format_v3/semantic/encode.rs:216–228  ·  view source on GitHub ↗
(
    ops: &[FileOps],
    content: &[u8],
    split_ids: bool,
)

Source from the content-addressed store, hash-verified

214}
215
216pub(super) fn encode_layout(
217 ops: &[FileOps],
218 content: &[u8],
219 split_ids: bool,
220) -> FormatResult<Vec<u8>> {
221 let c = columns(ops, content, split_ids)?;
222 let mut out = MAGIC.to_vec();
223 out.extend(postcard::to_allocvec(&c)?);
224 if out.len() > MAX_PAYLOAD {
225 return Err(super::super::FormatError::SemanticLimitExceeded);
226 }
227 Ok(out)
228}
229
230pub(super) fn columns(ops: &[FileOps], content: &[u8], split_ids: bool) -> FormatResult<Columns> {
231 if content.len() > MAX_PAYLOAD {

Calls 3

columnsFunction · 0.85
extendMethod · 0.80
lenMethod · 0.45