Skip to content
YosoiDocs

ValidatedString

yosoi.scalars.ValidatedString

class ValidatedString(str):

String scalar constructed and checked by its Rust SDK type.

Source: python/yosoi/scalars.py:34

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

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

Validate text using the domain-specific subclass constructor.

Args: value: Authored string to validate in Rust.

Returns: An immutable instance of the selected string scalar subclass.

Raises: YosoiError: The selected domain rejects the supplied string.

Source: python/yosoi/scalars.py:55

def as_str(self) -> str:

Return the validated retained spelling as an ordinary Python string.

Source: python/yosoi/scalars.py:69