# pyo3::class::number::PyNumberProtocol - Rust
Number interface
Keywords: rust, rustlang, rust-lang, PyNumberProtocol

# Trait pyo3::class::number::PyNumberProtocol [−] [src]

    pub trait PyNumberProtocol<'p>: PyClass {
        fn __add__(lhs: Self::Left, rhs: Self::Right) -> Self::Result
        where
            Self: PyNumberAddProtocol<'p>,
        { ... }
        fn __sub__(lhs: Self::Left, rhs: Self::Right) -> Self::Result
        where
            Self: PyNumberSubProtocol<'p>,
        { ... }
        fn __mul__(lhs: Self::Left, rhs: Self::Right) -> Self::Result
        where
            Self: PyNumberMulProtocol<'p>,
        { ... }
        fn __matmul__(lhs: Self::Left, rhs: Self::Right) -> Self::Result
        where
            Self: PyNumberMatmulProtocol<'p>,
        { ... }
        fn __truediv__(lhs: Self::Left, rhs: Self::Right) -> Self::Result
        where
            Self: PyNumberTruedivProtocol<'p>,
        { ... }
        fn __floordiv__(lhs: Self::Left, rhs: Self::Right) -> Self::Result
        where
            Self: PyNumberFloordivProtocol<'p>,
        { ... }
        fn __mod__(lhs: Self::Left, rhs: Self::Right) -> Self::Result
        where
            Self: PyNumberModProtocol<'p>,
        { ... }
        fn __divmod__(lhs: Self::Left, rhs: Self::Right) -> Self::Result
        where
            Self: PyNumberDivmodProtocol<'p>,
        { ... }
        fn __pow__(
            lhs: Self::Left,
            rhs: Self::Right,
            modulo: Option<Self::Modulo>
        ) -> Self::Result
        where
            Self: PyNumberPowProtocol<'p>,
        { ... }
        fn __lshift__(lhs: Self::Left, rhs: Self::Right) -> Self::Result
        where
            Self: PyNumberLShiftProtocol<'p>,
        { ... }
        fn __rshift__(lhs: Self::Left, rhs: Self::Right) -> Self::Result
        where
            Self: PyNumberRShiftProtocol<'p>,
        { ... }
        fn __and__(lhs: Self::Left, rhs: Self::Right) -> Self::Result
        where
            Self: PyNumberAndProtocol<'p>,
        { ... }
        fn __xor__(lhs: Self::Left, rhs: Self::Right) -> Self::Result
        where
            Self: PyNumberXorProtocol<'p>,
        { ... }
        fn __or__(lhs: Self::Left, rhs: Self::Right) -> Self::Result
        where
            Self: PyNumberOrProtocol<'p>,
        { ... }
        fn __radd__(&'p self, other: Self::Other) -> Self::Result
        where
            Self: PyNumberRAddProtocol<'p>,
        { ... }
        fn __rsub__(&'p self, other: Self::Other) -> Self::Result
        where
            Self: PyNumberRSubProtocol<'p>,
        { ... }
        fn __rmul__(&'p self, other: Self::Other) -> Self::Result
        where
            Self: PyNumberRMulProtocol<'p>,
        { ... }
        fn __rmatmul__(&'p self, other: Self::Other) -> Self::Result
        where
            Self: PyNumberRMatmulProtocol<'p>,
        { ... }
        fn __rtruediv__(&'p self, other: Self::Other) -> Self::Result
        where
            Self: PyNumberRTruedivProtocol<'p>,
        { ... }
        fn __rfloordiv__(&'p self, other: Self::Other) -> Self::Result
        where
            Self: PyNumberRFloordivProtocol<'p>,
        { ... }
        fn __rmod__(&'p self, other: Self::Other) -> Self::Result
        where
            Self: PyNumberRModProtocol<'p>,
        { ... }
        fn __rdivmod__(&'p self, other: Self::Other) -> Self::Result
        where
            Self: PyNumberRDivmodProtocol<'p>,
        { ... }
        fn __rpow__(
            &'p self,
            other: Self::Other,
            modulo: Option<Self::Modulo>
        ) -> Self::Result
        where
            Self: PyNumberRPowProtocol<'p>,
        { ... }
        fn __rlshift__(&'p self, other: Self::Other) -> Self::Result
        where
            Self: PyNumberRLShiftProtocol<'p>,
        { ... }
        fn __rrshift__(&'p self, other: Self::Other) -> Self::Result
        where
            Self: PyNumberRRShiftProtocol<'p>,
        { ... }
        fn __rand__(&'p self, other: Self::Other) -> Self::Result
        where
            Self: PyNumberRAndProtocol<'p>,
        { ... }
        fn __rxor__(&'p self, other: Self::Other) -> Self::Result
        where
            Self: PyNumberRXorProtocol<'p>,
        { ... }
        fn __ror__(&'p self, other: Self::Other) -> Self::Result
        where
            Self: PyNumberROrProtocol<'p>,
        { ... }
        fn __iadd__(&'p mut self, other: Self::Other) -> Self::Result
        where
            Self: PyNumberIAddProtocol<'p>,
        { ... }
        fn __isub__(&'p mut self, other: Self::Other) -> Self::Result
        where
            Self: PyNumberISubProtocol<'p>,
        { ... }
        fn __imul__(&'p mut self, other: Self::Other) -> Self::Result
        where
            Self: PyNumberIMulProtocol<'p>,
        { ... }
        fn __imatmul__(&'p mut self, other: Self::Other) -> Self::Result
        where
            Self: PyNumberIMatmulProtocol<'p>,
        { ... }
        fn __itruediv__(&'p mut self, other: Self::Other) -> Self::Result
        where
            Self: PyNumberITruedivProtocol<'p>,
        { ... }
        fn __ifloordiv__(&'p mut self, other: Self::Other) -> Self::Result
        where
            Self: PyNumberIFloordivProtocol<'p>,
        { ... }
        fn __imod__(&'p mut self, other: Self::Other) -> Self::Result
        where
            Self: PyNumberIModProtocol<'p>,
        { ... }
        fn __ipow__(&'p mut self, other: Self::Other) -> Self::Result
        where
            Self: PyNumberIPowProtocol<'p>,
        { ... }
        fn __ilshift__(&'p mut self, other: Self::Other) -> Self::Result
        where
            Self: PyNumberILShiftProtocol<'p>,
        { ... }
        fn __irshift__(&'p mut self, other: Self::Other) -> Self::Result
        where
            Self: PyNumberIRShiftProtocol<'p>,
        { ... }
        fn __iand__(&'p mut self, other: Self::Other) -> Self::Result
        where
            Self: PyNumberIAndProtocol<'p>,
        { ... }
        fn __ixor__(&'p mut self, other: Self::Other) -> Self::Result
        where
            Self: PyNumberIXorProtocol<'p>,
        { ... }
        fn __ior__(&'p mut self, other: Self::Other) -> Self::Result
        where
            Self: PyNumberIOrProtocol<'p>,
        { ... }
        fn __neg__(&'p self) -> Self::Result
        where
            Self: PyNumberNegProtocol<'p>,
        { ... }
        fn __pos__(&'p self) -> Self::Result
        where
            Self: PyNumberPosProtocol<'p>,
        { ... }
        fn __abs__(&'p self) -> Self::Result
        where
            Self: PyNumberAbsProtocol<'p>,
        { ... }
        fn __invert__(&'p self) -> Self::Result
        where
            Self: PyNumberInvertProtocol<'p>,
        { ... }
        fn __complex__(&'p self) -> Self::Result
        where
            Self: PyNumberComplexProtocol<'p>,
        { ... }
        fn __int__(&'p self) -> Self::Result
        where
            Self: PyNumberIntProtocol<'p>,
        { ... }
        fn __float__(&'p self) -> Self::Result
        where
            Self: PyNumberFloatProtocol<'p>,
        { ... }
        fn __index__(&'p self) -> Self::Result
        where
            Self: PyNumberIndexProtocol<'p>,
        { ... }
        fn __round__(&'p self, ndigits: Option<Self::NDigits>) -> Self::Result
        where
            Self: PyNumberRoundProtocol<'p>,
        { ... }
    }

Number interface

## Provided methods

### `fn __add__(lhs: Self::Left, rhs: Self::Right) -> Self::Result where
Self: PyNumberAddProtocol<'p>,` [src]

### `fn __sub__(lhs: Self::Left, rhs: Self::Right) -> Self::Result where
Self: PyNumberSubProtocol<'p>,` [src]

### `fn __mul__(lhs: Self::Left, rhs: Self::Right) -> Self::Result where
Self: PyNumberMulProtocol<'p>,` [src]

### `fn __matmul__(lhs: Self::Left, rhs: Self::Right) -> Self::Result where
Self: PyNumberMatmulProtocol<'p>,` [src]

### `fn __truediv__(lhs: Self::Left, rhs: Self::Right) -> Self::Result where
Self: PyNumberTruedivProtocol<'p>,` [src]

### `fn __floordiv__(lhs: Self::Left, rhs: Self::Right) -> Self::Result where
Self: PyNumberFloordivProtocol<'p>,` [src]

### `fn __mod__(lhs: Self::Left, rhs: Self::Right) -> Self::Result where
Self: PyNumberModProtocol<'p>,` [src]

### `fn __divmod__(lhs: Self::Left, rhs: Self::Right) -> Self::Result where
Self: PyNumberDivmodProtocol<'p>,` [src]

### `fn __pow__(
lhs: Self::Left,
rhs: Self::Right,
modulo: Option<Self::Modulo>
) -> Self::Result where
Self: PyNumberPowProtocol<'p>,` [src]

### `fn __lshift__(lhs: Self::Left, rhs: Self::Right) -> Self::Result where
Self: PyNumberLShiftProtocol<'p>,` [src]

### `fn __rshift__(lhs: Self::Left, rhs: Self::Right) -> Self::Result where
Self: PyNumberRShiftProtocol<'p>,` [src]

### `fn __and__(lhs: Self::Left, rhs: Self::Right) -> Self::Result where
Self: PyNumberAndProtocol<'p>,` [src]

### `fn __xor__(lhs: Self::Left, rhs: Self::Right) -> Self::Result where
Self: PyNumberXorProtocol<'p>,` [src]

### `fn __or__(lhs: Self::Left, rhs: Self::Right) -> Self::Result where
Self: PyNumberOrProtocol<'p>,` [src]

### `fn __radd__(&'p self, other: Self::Other) -> Self::Result where
Self: PyNumberRAddProtocol<'p>,` [src]

### `fn __rsub__(&'p self, other: Self::Other) -> Self::Result where
Self: PyNumberRSubProtocol<'p>,` [src]

### `fn __rmul__(&'p self, other: Self::Other) -> Self::Result where
Self: PyNumberRMulProtocol<'p>,` [src]

### `fn __rmatmul__(&'p self, other: Self::Other) -> Self::Result where
Self: PyNumberRMatmulProtocol<'p>,` [src]

### `fn __rtruediv__(&'p self, other: Self::Other) -> Self::Result where
Self: PyNumberRTruedivProtocol<'p>,` [src]

### `fn __rfloordiv__(&'p self, other: Self::Other) -> Self::Result where
Self: PyNumberRFloordivProtocol<'p>,` [src]

### `fn __rmod__(&'p self, other: Self::Other) -> Self::Result where
Self: PyNumberRModProtocol<'p>,` [src]

### `fn __rdivmod__(&'p self, other: Self::Other) -> Self::Result where
Self: PyNumberRDivmodProtocol<'p>,` [src]

### `fn __rpow__(
&'p self,
other: Self::Other,
modulo: Option<Self::Modulo>
) -> Self::Result where
Self: PyNumberRPowProtocol<'p>,` [src]

### `fn __rlshift__(&'p self, other: Self::Other) -> Self::Result where
Self: PyNumberRLShiftProtocol<'p>,` [src]

### `fn __rrshift__(&'p self, other: Self::Other) -> Self::Result where
Self: PyNumberRRShiftProtocol<'p>,` [src]

### `fn __rand__(&'p self, other: Self::Other) -> Self::Result where
Self: PyNumberRAndProtocol<'p>,` [src]

### `fn __rxor__(&'p self, other: Self::Other) -> Self::Result where
Self: PyNumberRXorProtocol<'p>,` [src]

### `fn __ror__(&'p self, other: Self::Other) -> Self::Result where
Self: PyNumberROrProtocol<'p>,` [src]

### `fn __iadd__(&'p mut self, other: Self::Other) -> Self::Result where
Self: PyNumberIAddProtocol<'p>,` [src]

### `fn __isub__(&'p mut self, other: Self::Other) -> Self::Result where
Self: PyNumberISubProtocol<'p>,` [src]

### `fn __imul__(&'p mut self, other: Self::Other) -> Self::Result where
Self: PyNumberIMulProtocol<'p>,` [src]

### `fn __imatmul__(&'p mut self, other: Self::Other) -> Self::Result where
Self: PyNumberIMatmulProtocol<'p>,` [src]

### `fn __itruediv__(&'p mut self, other: Self::Other) -> Self::Result where
Self: PyNumberITruedivProtocol<'p>,` [src]

### `fn __ifloordiv__(&'p mut self, other: Self::Other) -> Self::Result where
Self: PyNumberIFloordivProtocol<'p>,` [src]

### `fn __imod__(&'p mut self, other: Self::Other) -> Self::Result where
Self: PyNumberIModProtocol<'p>,` [src]

### `fn __ipow__(&'p mut self, other: Self::Other) -> Self::Result where
Self: PyNumberIPowProtocol<'p>,` [src]

### `fn __ilshift__(&'p mut self, other: Self::Other) -> Self::Result where
Self: PyNumberILShiftProtocol<'p>,` [src]

### `fn __irshift__(&'p mut self, other: Self::Other) -> Self::Result where
Self: PyNumberIRShiftProtocol<'p>,` [src]

### `fn __iand__(&'p mut self, other: Self::Other) -> Self::Result where
Self: PyNumberIAndProtocol<'p>,` [src]

### `fn __ixor__(&'p mut self, other: Self::Other) -> Self::Result where
Self: PyNumberIXorProtocol<'p>,` [src]

### `fn __ior__(&'p mut self, other: Self::Other) -> Self::Result where
Self: PyNumberIOrProtocol<'p>,` [src]

### `fn __neg__(&'p self) -> Self::Result where
Self: PyNumberNegProtocol<'p>,` [src]

### `fn __pos__(&'p self) -> Self::Result where
Self: PyNumberPosProtocol<'p>,` [src]

### `fn __abs__(&'p self) -> Self::Result where
Self: PyNumberAbsProtocol<'p>,` [src]

### `fn __invert__(&'p self) -> Self::Result where
Self: PyNumberInvertProtocol<'p>,` [src]

### `fn __complex__(&'p self) -> Self::Result where
Self: PyNumberComplexProtocol<'p>,` [src]

### `fn __int__(&'p self) -> Self::Result where
Self: PyNumberIntProtocol<'p>,` [src]

### `fn __float__(&'p self) -> Self::Result where
Self: PyNumberFloatProtocol<'p>,` [src]

### `fn __index__(&'p self) -> Self::Result where
Self: PyNumberIndexProtocol<'p>,` [src]

### `fn __round__(&'p self, ndigits: Option<Self::NDigits>) -> Self::Result where
Self: PyNumberRoundProtocol<'p>,` [src]

Loading content...

## Implementors

Loading content...