Attempts to read from the underlying file. Reads up to ``len(buf)`` bytes, storing them in the buffer. Returns the number of bytes read. Returns None if there was nothing to read (the socket returned `~errno.EWOULDBLOCK` or equivalent), and zero on EOF. .. v
(self, buf: Union[bytearray, memoryview])
| 299 | raise NotImplementedError() |
| 300 | |
| 301 | def read_from_fd(self, buf: Union[bytearray, memoryview]) -> Optional[int]: |
| 302 | """Attempts to read from the underlying file. |
| 303 | |
| 304 | Reads up to ``len(buf)`` bytes, storing them in the buffer. |
| 305 | Returns the number of bytes read. Returns None if there was |
| 306 | nothing to read (the socket returned `~errno.EWOULDBLOCK` or |
| 307 | equivalent), and zero on EOF. |
| 308 | |
| 309 | .. versionchanged:: 5.0 |
| 310 | |
| 311 | Interface redesigned to take a buffer and return a number |
| 312 | of bytes instead of a freshly-allocated object. |
| 313 | """ |
| 314 | raise NotImplementedError() |
| 315 | |
| 316 | def get_fd_error(self) -> Optional[Exception]: |
| 317 | """Returns information about any error on the underlying file. |