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

Function reply

libatomic/examples/replication_acceptance/peer.rs:112–119  ·  view source on GitHub ↗
(status: StatusCode, body: Vec<u8>, kind: &str)

Source from the content-addressed store, hash-verified

110 }
111}
112fn reply(status: StatusCode, body: Vec<u8>, kind: &str) -> Response {
113 (
114 status,
115 [(PROTOCOL_HEADER, PROTOCOL_SYNC_V1), ("content-type", kind)],
116 body,
117 )
118 .into_response()
119}
120fn supported(headers: &HeaderMap) -> bool {
121 headers.get(PROTOCOL_HEADER).and_then(|h| h.to_str().ok()) == Some(PROTOCOL_SYNC_V1)
122}

Callers 3

errorFunction · 0.85
pushFunction · 0.85
pullFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected