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

Function compressed_compact

atomic-core/src/change/format_v3/semantic/mod.rs:135–153  ·  view source on GitHub ↗
(
    ops: &[FileOps],
    content: &[u8],
    split: bool,
)

Source from the content-addressed store, hash-verified

133}
134
135fn compressed_compact(
136 ops: &[FileOps],
137 content: &[u8],
138 split: bool,
139) -> FormatResult<SelectedSemantic> {
140 let payload = encode::encode_layout(ops, content, split)?;
141 let compressed = zstd::encode_all(payload.as_slice(), 3)
142 .map_err(|e| FormatError::Compress(e.to_string()))?;
143 if compressed.len() > wire::MAX_PAYLOAD {
144 return Err(FormatError::SemanticLimitExceeded);
145 }
146 Ok(SelectedSemantic {
147 compact: true,
148 predictive: false,
149 compressed,
150 uncompressed_len: payload.len(),
151 fallback: None,
152 })
153}

Callers 1

selectFunction · 0.85

Calls 3

encode_layoutFunction · 0.85
as_sliceMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected