MCPcopy
hub / github.com/danielgtaylor/python-betterproto / SerializeToString

Method SerializeToString

src/betterproto/__init__.py:1125–1138  ·  view source on GitHub ↗

Get the binary encoded Protobuf representation of this message instance. .. note:: This is a method for compatibility with other libraries, you should really use ``bytes(x)``. Returns -------- :class:`bytes` The binary en

(self: T)

Source from the content-addressed store, hash-verified

1123
1124 # For compatibility with other libraries
1125 def SerializeToString(self: T) -> bytes:
1126 """
1127 Get the binary encoded Protobuf representation of this message instance.
1128
1129 .. note::
1130 This is a method for compatibility with other libraries,
1131 you should really use ``bytes(x)``.
1132
1133 Returns
1134 --------
1135 :class:`bytes`
1136 The binary encoded Protobuf representation of this message instance
1137 """
1138 return bytes(self)
1139
1140 def __getstate__(self) -> bytes:
1141 return bytes(self)

Callers 6

mainFunction · 0.80
dump_requestFunction · 0.80
test_datetime_clampingFunction · 0.80
test_empty_message_fieldFunction · 0.80

Calls

no outgoing calls

Tested by 4

test_datetime_clampingFunction · 0.64
test_empty_message_fieldFunction · 0.64