MCPcopy Index your code
hub / github.com/RustPython/RustPython / send_bytes

Method send_bytes

Lib/multiprocessing/connection.py:182–200  ·  view source on GitHub ↗

Send the bytes data from a bytes-like object

(self, buf, offset=0, size=None)

Source from the content-addressed store, hash-verified

180 self._handle = None
181
182 def send_bytes(self, buf, offset=0, size=None):
183 """Send the bytes data from a bytes-like object"""
184 self._check_closed()
185 self._check_writable()
186 m = memoryview(buf)
187 if m.itemsize > 1:
188 m = m.cast('B')
189 n = m.nbytes
190 if offset < 0:
191 raise ValueError("offset is negative")
192 if n < offset:
193 raise ValueError("buffer length < offset")
194 if size is None:
195 size = n - offset
196 elif size < 0:
197 raise ValueError("size is negative")
198 elif offset + size > n:
199 raise ValueError("buffer length < offset + size")
200 self._send_bytes(m[offset:offset + size])
201
202 def send(self, obj):
203 """Send a (picklable) object"""

Callers 6

wakeupMethod · 0.45
putMethod · 0.45
deliver_challengeFunction · 0.45
answer_challengeFunction · 0.45
sendMethod · 0.45
sendMethod · 0.45

Calls 4

_check_closedMethod · 0.95
_check_writableMethod · 0.95
castMethod · 0.45
_send_bytesMethod · 0.45

Tested by

no test coverage detected