pyo3::types

Trait PyComplexMethods

Source
pub trait PyComplexMethods<'py>: Sealed {
    // Required methods
    fn real(&self) -> c_double;
    fn imag(&self) -> c_double;
    fn abs(&self) -> c_double;
    fn pow(&self, other: &Bound<'py, PyComplex>) -> Bound<'py, PyComplex>;
}
Expand description

Implementation of functionality for PyComplex.

These methods are defined for the Bound<'py, PyComplex> smart pointer, so to use method call syntax these methods are separated into a trait, because stable Rust does not yet support arbitrary_self_types.

Required Methods§

Source

fn real(&self) -> c_double

Returns the real part of the complex number.

Source

fn imag(&self) -> c_double

Returns the imaginary part of the complex number.

Source

fn abs(&self) -> c_double

Returns |self|.

Source

fn pow(&self, other: &Bound<'py, PyComplex>) -> Bound<'py, PyComplex>

Returns self raised to the power of other.

Implementors§

Source§

impl<'py> PyComplexMethods<'py> for Bound<'py, PyComplex>