Skip to main content

SchemaDict

No overview available.

Methods


get_as()

def get_as(
key: Bound< 'py, PyString >
) - > PyResult< Option< T > >

Retrieves an optional value from the schema dictionary and attempts to convert it to the specified type.

Parameters

NameTypeDescription
keyBound< 'py, PyString >The dictionary key string used to look up the desired value.

Returns

TypeDescription
PyResult< Option< T > >The value associated with the key if it exists and is convertible, otherwise None; wrapped in a PyResult.

get_as_req()

def get_as_req(
key: Bound< 'py, PyString >
) - > PyResult< T >

Retrieves a required value from the schema dictionary and converts it to the specified type, raising an error if the key is missing.

Parameters

NameTypeDescription
keyBound< 'py, PyString >The dictionary key string used to look up the required value.

Returns

TypeDescription
PyResult< T >The converted value associated with the key; wrapped in a PyResult.