# pyo3::class::basic::PyObjectProtocol - Rust
Basic Python class customization
Keywords: rust, rustlang, rust-lang, PyObjectProtocol

# Trait pyo3::class::basic::PyObjectProtocol [−] [src]

    pub trait PyObjectProtocol<'p>: PyClass {
        fn __getattr__(&'p self, name: Self::Name) -> Self::Result
        where
            Self: PyObjectGetAttrProtocol<'p>,
        { ... }
        fn __setattr__(
            &'p mut self,
            name: Self::Name,
            value: Self::Value
        ) -> Self::Result
        where
            Self: PyObjectSetAttrProtocol<'p>,
        { ... }
        fn __delattr__(&'p mut self, name: Self::Name) -> Self::Result
        where
            Self: PyObjectDelAttrProtocol<'p>,
        { ... }
        fn __str__(&'p self) -> Self::Result
        where
            Self: PyObjectStrProtocol<'p>,
        { ... }
        fn __repr__(&'p self) -> Self::Result
        where
            Self: PyObjectReprProtocol<'p>,
        { ... }
        fn __format__(&'p self, format_spec: Self::Format) -> Self::Result
        where
            Self: PyObjectFormatProtocol<'p>,
        { ... }
        fn __hash__(&'p self) -> Self::Result
        where
            Self: PyObjectHashProtocol<'p>,
        { ... }
        fn __bytes__(&'p self) -> Self::Result
        where
            Self: PyObjectBytesProtocol<'p>,
        { ... }
        fn __richcmp__(&'p self, other: Self::Other, op: CompareOp) -> Self::Result
        where
            Self: PyObjectRichcmpProtocol<'p>,
        { ... }
        fn __bool__(&'p self) -> Self::Result
        where
            Self: PyObjectBoolProtocol<'p>,
        { ... }
    }

Basic Python class customization

## Provided methods

### `fn __getattr__(&'p self, name: Self::Name) -> Self::Result where
Self: PyObjectGetAttrProtocol<'p>,` [src]

### `fn __setattr__(
&'p mut self,
name: Self::Name,
value: Self::Value
) -> Self::Result where
Self: PyObjectSetAttrProtocol<'p>,` [src]

### `fn __delattr__(&'p mut self, name: Self::Name) -> Self::Result where
Self: PyObjectDelAttrProtocol<'p>,` [src]

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

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

### `fn __format__(&'p self, format_spec: Self::Format) -> Self::Result where
Self: PyObjectFormatProtocol<'p>,` [src]

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

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

### `fn __richcmp__(&'p self, other: Self::Other, op: CompareOp) -> Self::Result where
Self: PyObjectRichcmpProtocol<'p>,` [src]

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

Loading content...

## Implementors

Loading content...