Context manager that accepts acquisition and release functions, along with an optinal validation function.
An implementation of a circular buffer, derived from include/linux/circ_buf.h.
Returns: | buffer length |
---|
Returns: | count up to the end of the buffer |
---|
Parameters: | cnt – consumed bytes |
---|---|
Returns: | consumed bytes |
Returns: | consumer buffer |
---|---|
Return type: | memoryview |
Parameters: | cnt – written bytes |
---|---|
Returns: | written bytes |
Returns: | producer buffer |
---|---|
Return type: | memoryview |
Returns: | number of bytes available in the buffer |
---|
Returns: | space available up to the end of the buffer |
---|
Parameters: | b – bytes to bytearray to write |
---|---|
Returns: | number of bytes written |
Helper to read from a function which receives into buf
Parameters: |
|
---|
to read into and returns the number of bytes received :param args: arguments for fn
Helper to seek buf to pattern
Parameters: |
|
---|---|
Returns: | remaining buf length |