ChunkSourceBox
struct ChunkSourceBoxMove-only, type-erased owner of a heap-boxed ChunkSource.
Built via :meth:create; drives the source via :meth:next; frees
the box exactly once on drop (or when moved-from, ownership
transfers so the destructor runs only on the final owner). The
reactor takes the box out of a Response onto its per-connection
state and pulls next(cancel) in bounded batches per writable
edge until it returns None (end-of-stream).
Implements Movable
- Fields
addr: Int: Heap address of the boxed concrete source (0 = empty / moved-from).
__init__
def __init__(out self, addr: Int, next_fn: def(Int, Cancel) raises thin -> Optional[List[UInt8]], destroy_fn: def(Int) thin -> None) __deinit__
def __deinit__(deinit self) create
def create[S: ChunkSource](var source: S) -> Self Heap-box source and capture its monomorphised thunks.
next
def next(mut self, cancel: Cancel) -> Optional[List[UInt8]] Pull the next chunk, or None at end-of-stream.