Crate rigetti_pyo3
source ·Expand description
Re-exports§
pub use num_complex;
pub use paste;
pub use pyo3;
Modules§
- Defines
DateTime
to make converting between Python andtime
easier.
Macros§
- Create a crate-private function
init_submodule
to 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
ToPython<Self>
for a given type. - Implement
__hash__
for types that implementHash
. - Implement a method
parse
for wrapper types that implementFromStr
. - Implement
__repr__
for wrapper types whose inner type implementsDebug
. - Implement
__str__
for wrapper types whose inner type implementsDisplay
. - Implement
PyTryFrom
for a given Rust type. - Generate
PyTryFrom
implementations forPyAny
that require thePyAny
to contain a specific Python type. - Implement
PyTryFrom<PyAny>
for a given Rust type by delegating to its implementation for the given Python type. - Implement
ToPython
once 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
ToPython
on 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
struct
so 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
.