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

Method is_session_envelope

atomic-core/src/change/envelope.rs:329–331  ·  view source on GitHub ↗

Check whether a byte slice looks like a `SessionEnvelope`. This is a fast check (just the 4-byte magic prefix) that the server can use to identify which changes have session data without fully deserializing. Used during push receipt to index session turns. # Example ```rust use atomic_core::change::envelope::SessionEnvelope; let envelope = SessionEnvelope::builder("s1", "claude-code").build();

(data: &[u8])

Source from the content-addressed store, hash-verified

327 /// assert!(!SessionEnvelope::is_session_envelope(b"ATS")); // too short
328 /// ```
329 pub fn is_session_envelope(data: &[u8]) -> bool {
330 data.len() >= MAGIC.len() && &data[..4] == MAGIC
331 }
332
333 /// Returns the number of files changed in this turn.
334 pub fn turn_file_count(&self) -> usize {

Callers

nothing calls this directly

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected