MCPcopy Create free account
hub / github.com/apache/qpid-proton / py2bytes

Function py2bytes

python/cproton.py:207–213  ·  view source on GitHub ↗
(py)

Source from the content-addressed store, hash-verified

205
206
207def py2bytes(py):
208 if isinstance(py, (bytes, bytearray, memoryview)):
209 s = ffi.from_buffer(py)
210 return len(s), s
211 elif isinstance(py, str):
212 s = ffi.from_buffer(py.encode('utf8'))
213 return len(s), s
214
215
216def string2bytes(py, encoding='utf8'):

Callers 4

py2msgidFunction · 0.85
pn_data_put_binaryFunction · 0.85
pn_deliveryFunction · 0.85
pn_message_set_user_idFunction · 0.85

Calls 1

encodeMethod · 0.45

Tested by

no test coverage detected