Skip to main content

EitherBytes

No overview available.

Attributes

AttributeTypeDescription
CowCow< 'a, [u8] >Stores a Rust-native byte slice that can be either borrowed or owned, used for efficient data handling without Python overhead.
PyBound< 'py, PyBytes >Stores a reference to a Python bytes object, allowing direct interaction with Python-managed memory within the enum.

Constructor

Signature

def Cow(
data: Cow< 'a, [u8] >
) - > [EitherBytes](eitherbytes.md?sid=input_return_enums_eitherbytes)

Parameters

NameTypeDescription
dataCow< 'a, [u8] >The byte data to be wrapped, provided as a clone-on-write byte slice.

Signature

def Py(
data: Bound< 'py, PyBytes >
) - > [EitherBytes](eitherbytes.md?sid=input_return_enums_eitherbytes)

Parameters

NameTypeDescription
dataBound< 'py, PyBytes >The Python bytes object to be wrapped, bound to the current Python interpreter session.