Expand description
Zero-copy multimodal buffers — §λ-L-E Fase 11.b.
Bytes that enter the runtime through a network socket, file
handle or FFI boundary land directly in a region of Rust-
owned memory. The Python layer manipulates SymbolicPtr<T>
handles (Arc clones) — never the raw bytes — until the final
consumer (transcoder, compressor, sink) asks for a slice.
Three building blocks:
BufferKind— content-kind tag (raw,pcm16,mulaw8,jpeg, …). Extensible (unlike the closed catalogues of 11.a); adopters can register new kinds via [BufferKind::register].ZeroCopyBuffer— the primitive. AnArc<[u8]>plus aBufferKindtag. Clone is O(1) (Arc refcount bump); slicing returns anotherZeroCopyBufferthat shares the same backing allocation.BufferMut— mutable in-flight builder. Accumulates bytes during ingest then.freeze()s into an immutableZeroCopyBufferat end-of-stream.
Pool-backed allocation lives in the sibling pool module.
Re-exports§
pub use self::kind::BufferKind;pub use self::kind::BufferKindRegistry;pub use self::pool::BufferPool;pub use self::pool::BufferPoolSnapshot;pub use self::pool::PoolClass;
Modules§
- kind
BufferKind— content-kind tags for multimodal buffers.- pool
BufferPool— slab allocator for [ZeroCopyBuffer] storage.
Structs§
- Buffer
Mut - Mutable append-only builder used while bytes are still arriving.
When the ingest stream terminates, call
BufferMut::freezeto convert into an immutableZeroCopyBufferwith a single Arc construction (no copy). - Zero
Copy Buffer - An immutable view over a region of bytes. Cloneable at O(1) — the
backing storage is an
Arc<[u8]>so clones are refcount bumps.