Skip to main content

MarshalPbToBytes

Marshals a proto message to a byte slice.

def MarshalPbToBytes(
msg: proto.Message
) - > ([]byte, error)

Marshals a proto message to a byte slice, allowing for serialization of protocol buffer messages into a binary format.

Parameters

NameTypeDescription
msgproto.MessageThe proto message to be marshaled into a byte slice.

Returns

TypeDescription
([]byte, error)A byte slice representing the marshaled proto message, or an error if the marshaling fails.