Crate rigetti_pyo3
source ·Expand description
Re-exports§
pub use num_complex;pub use paste;pub use pyo3;
Modules§
- Defines
DateTimeto make converting between Python andtimeeasier.
Macros§
- Create a crate-private function
init_submoduleto set up this submodule and call the same function on child modules (which should also use this macro). - Implement
AsMut<T>for a Python wrapper aroundT. - Implement Python comparison for a given type. That type must implement
PartialOrd. - Implement
__hash__for types that implementHash. - Implement a method
parsefor wrapper types that implementFromStr. - Implement
__repr__for wrapper types whose inner type implementsDebug. - Implement
__str__for wrapper types whose inner type implementsDisplay. - Implement
PyTryFromfor a given Rust type. - Generate
PyTryFromimplementations forPyAnythat require thePyAnyto contain a specific Python type. - Implement
PyTryFrom<PyAny>for a given Rust type by delegating to its implementation for the given Python type. - Implement
ToPythononce for the given Rust type. Will implement for a reference to the type if a lifetime is provided. - Implement
ToPython<Py<PyAny>>for a type using its implementation forToPython<P>whereP: ToPyObject. - Implement
ToPythonon the given Rust type and a reference to it. - (Internal) Helper macro to implement chained conversion through intermediate types, where the type system cannot determine a path from the first to last item.
- (Internal) Helper macro to implement chained conversion through intermediate types, where the type system cannot determine a path from the last to first item.
- Provides a body for
py_try_from, delegating to the implementation for the given Python type. - (Internal) Helper macro to get the final type in a chain of conversions.
- Wraps a data struct and makes (some of) its fields available to Python.
- Creates a new exception type and implements converting from the given Rust error to the new exception.
- Wrap an enum containing only unit variants.
- Create a newtype wrapper for a Rust struct.
- Create a Python wrapper around a Rust type.
- Create a newtype wrapper for a Rust enum with unique 1-tuple variants.
- Wraps an external error type in a newtype
structso it can be used withpy_wrap_error.
Traits§
- Convert from a Python type to a Rust type.
- Implemented by wrapper types generated with
py_wrap_*macros: - Implemented by wrapper types containing the source type, generated with
py_wrap_*macros: - Convert from a Rust type into a Python type.
- Implemented by error types generated with
py_wrap_error.