Skip to content

OutputChunk

@final
class OutputChunk

Output bytes, with the offset they start at.

data is bytes and not str: exec output is arbitrary bytes, and a decode here would be a lossy step the caller cannot see. end is where a cursor resumes.

OutputChunk declares no __new__ or __init__, so it is not constructed directly: an instance comes back from another call in this package.

data: bytes
end: int

One past this chunk’s last byte: offset + len(data).

kind: str

"output" — the tag beside isinstance, so a caller can branch either way.

offset: int
stream: str

"stdout" or "stderr". Both share one offset space, so a caller holds one cursor rather than two that can disagree about ordering.

def text() -> str

The bytes as text, replacing anything undecodable.

A method rather than a getter on data, so the lossy step is a call a reader sees — the same reasoning as the core’s break_even_seconds_f64.

def __repr__() -> str

This page is generated from bindings/microvms-py/microvms.pyi by Griffe 2.3.0, run from site/scripts/gen-reference.mjs on every pnpm run sync, so an edit made here is overwritten by the next run.

To change the page, change the doc comment in the binding’s Rust source, then regenerate the declarations with mise run stubs. mise run stubs:check fails when the committed file no longer matches the source.