Skip to content
YosoiDocs

RuntimeZeroOrOne

yosoi.runtime_contracts.RuntimeZeroOrOne

class RuntimeZeroOrOne(ImmutableModel):

Carry an optional field after cardinality and conversion checks.

Attributes: cardinality: Wire discriminator for zero-or-one cardinality. value: Validated value, or None when the optional field has no evidence.

Source: python/yosoi/runtime_contracts.py:105

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

cardinality: Literal['zero_or_one']
value: RuntimeValue | None