MCPcopy Create free account
hub / github.com/blobcache/blobcache / SetSendable

Method SetSendable

src/bcp/message.go:181–186  ·  view source on GitHub ↗

SetSendable sets the body of the message to a Sendable

(x Sendable)

Source from the content-addressed store, hash-verified

179
180// SetSendable sets the body of the message to a Sendable
181func (m *Message) SetSendable(x Sendable) {
182 m.buf = x.Marshal(m.buf[:HeaderLen])
183 h := m.Header()
184 h.SetBodyLen(len(m.buf) - HeaderLen)
185 m.setHeader(h)
186}
187
188func (m *Message) Body() []byte {
189 return m.buf[HeaderLen:]

Callers

nothing calls this directly

Calls 4

HeaderMethod · 0.95
setHeaderMethod · 0.95
SetBodyLenMethod · 0.80
MarshalMethod · 0.65

Tested by

no test coverage detected