Skip to content
YosoiDocs

ValidatedInteger

yosoi.scalars.ValidatedInteger

class ValidatedInteger(int):

Integer scalar with the width and constructor rules of its Rust type.

Source: python/yosoi/scalars.py:102

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

@classmethod
def try_new(cls, value: int) -> Self:

Validate an integer using the domain-specific subclass constructor.

Args: value: Authored integer in the selected scalar’s units.

Returns: An immutable scalar checked by its Rust constructor.

Raises: YosoiError: The selected domain rejects the width or value.

Source: python/yosoi/scalars.py:123

def get(self) -> int:

Return the retained numeric value without converting its units.

Source: python/yosoi/scalars.py:137