rusttypes.option

Classes

Members

rusttypes.option.Nil = rusttypes.option.NilType()

A final instance of the NilType class, representing a Nil value.

rusttypes.option.to_option(opt: T | None) Option[T]

Converts a Python Optional to a Option.

Parameters:

opt (Optional[T]) – The optional value to convert.

Returns:

The converted option.

Return type:

Option[T]

Examples:

>>> to_option(1)
Some(1)

>>> to_option(None)
Nil