ReprOutput
This class represents the output of a representation operation, providing a mechanism to handle both native Python string objects and fallback UTF-8 strings. It allows for flexible string representation by encapsulating either a bound Python string reference or a standard string buffer.
Attributes
| Attribute | Type | Description |
|---|---|---|
| Python | Bound< 'py, PyString > | Stores a reference to a Python string object used when the representation is generated within the Python runtime environment. |
| Fallback | String | Stores a standard Rust string used as a backup representation when a Python-bound string cannot be utilized. |
Constructor
Signature
def ReprOutput()
Signature
def Python(
value: Bound< 'py, PyString >
) - > [ReprOutput](reproutput.md?sid=tools_reproutput)
Parameters
| Name | Type | Description |
|---|---|---|
| value | Bound< 'py, PyString > | The bound Python string object to be returned as the representation. |
Signature
def Fallback(
value: String
) - > [ReprOutput](reproutput.md?sid=tools_reproutput)
Parameters
| Name | Type | Description |
|---|---|---|
| value | String | The UTF-8 encoded string to use as the fallback representation. |