Skip to content
YosoiDocs

ByteRange

yosoi.outcomes.ByteRange

class ByteRange(ImmutableModel):

Half-open byte offsets in an owned source payload, allowing empty ranges.

Attributes: start: Inclusive starting byte offset. end: Exclusive ending byte offset, not less than start. Bounds and UTF-8 boundaries are not verified against a document.

Source: python/yosoi/outcomes.py:69

Members below are declared on this class. Inherited Pydantic methods and generated constructor signatures are not expanded.

start: U64
end: U64
@classmethod
def try_new(cls, start: int, end: int) -> Self:

Validate half-open byte offsets through the Rust constructor.

Args: start: Inclusive source-byte offset. end: Exclusive offset; equality permits an empty range.

Returns: Validated offsets without a source-payload bounds or UTF-8 boundary check.

Raises: LocatorError: The range is reversed or its wire values are invalid.

Source: python/yosoi/outcomes.py:88