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.
Methods
Section titled “Methods”try_new
Section titled “try_new”@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
as_str
Section titled “as_str”def as_str(self) -> str:
Return the validated retained spelling as an ordinary Python string.