Skip to main content

Module buffers

Module buffers 

Source

Structs§

Buffer
A mutable buffer for reading and writing bytes data.
FrozenBuffer
An immutable buffer for reading bytes data.

Statics§

SMALL_WRITE_THRESHOLD
Threshold below which writes are copied into a contiguous buffer. Writes >= this size are stored as zero-copy references.

Functions§

py_bytes_to_bytes
Wrap an immutable Python bytes as a zero-copy [Bytes] that pins the PyBytes alive for the returned buffer’s lifetime, so its payload is never copied. This is the shared conversion behind Buffer::take_part’s reference fragments; callers that slice a block into chunks (e.g. the chain-broadcast source) reuse it to egress the block without a copy.
register_python_bindings