# pyo3::type_object::PyLayout - Rust
`T: PyLayout<U>` represents that `T` is a concrete representaion of `U` in Python heap. E.g., `PyCell` is a concrete representaion of all `pyclass`es, and `ffi::PyObject` is of `PyAny`.
Keywords: rust, rustlang, rust-lang, PyLayout

# Trait pyo3::type_object::PyLayout [−] [src]

    pub unsafe trait PyLayout<T: PyTypeInfo> {
        const IS_NATIVE_TYPE: bool;
        fn get_super(&mut self) -> Option<&mut T::BaseLayout> { ... }
        fn py_init(&mut self, _value: T) { ... }
        unsafe fn py_drop(&mut self, _py: Python<'_>) { ... }
    }

`T: PyLayout<U>` represents that `T` is a concrete representaion of `U` in Python heap. E.g., `PyCell` is a concrete representaion of all `pyclass`es, and `ffi::PyObject` is of `PyAny`.

This trait is intended to be used internally.

## Associated Constants

### `const IS_NATIVE_TYPE: bool` [src]

Loading content...

## Provided methods

### `fn get_super(&mut self) -> Option<&mut T::BaseLayout>` [src]

### `fn py_init(&mut self, _value: T)` [src]

### `unsafe fn py_drop(&mut self, _py: Python<'_>)` [src]

Loading content...

## Implementors

### `impl PyLayout<CancelledError> for PyBaseExceptionObject` [src]

### `impl PyLayout<IncompleteReadError> for PyBaseExceptionObject` [src]

### `impl PyLayout<InvalidStateError> for PyBaseExceptionObject` [src]

### `impl PyLayout<LimitOverrunError> for PyBaseExceptionObject` [src]

### `impl PyLayout<QueueEmpty> for PyBaseExceptionObject` [src]

### `impl PyLayout<QueueFull> for PyBaseExceptionObject` [src]

### `impl PyLayout<TimeoutError> for PyBaseExceptionObject` [src]

### `impl PyLayout<gaierror> for PyBaseExceptionObject` [src]

### `impl PyLayout<herror> for PyBaseExceptionObject` [src]

### `impl PyLayout<timeout> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyArithmeticError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyAssertionError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyAttributeError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyBaseException> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyBlockingIOError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyBrokenPipeError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyBufferError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyChildProcessError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyConnectionAbortedError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyConnectionError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyConnectionRefusedError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyConnectionResetError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyEOFError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyEnvironmentError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyException> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyFileExistsError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyFileNotFoundError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyFloatingPointError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyGeneratorExit> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyIOError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyImportError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyIndexError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyInterruptedError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyIsADirectoryError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyKeyError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyKeyboardInterrupt> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyLookupError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyMemoryError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyModuleNotFoundError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyNameError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyNotADirectoryError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyNotImplementedError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyOSError> for PyOSErrorObject` [src]

### `impl PyLayout<PyOverflowError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyPermissionError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyProcessLookupError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyRecursionError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyReferenceError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyRuntimeError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyStopAsyncIteration> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyStopIteration> for PyStopIterationObject` [src]

### `impl PyLayout<PySyntaxError> for PySyntaxErrorObject` [src]

### `impl PyLayout<PySystemError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PySystemExit> for PySystemExitObject` [src]

### `impl PyLayout<PyTimeoutError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyTypeError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyUnboundLocalError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyUnicodeDecodeError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyUnicodeEncodeError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyUnicodeError> for PyUnicodeErrorObject` [src]

### `impl PyLayout<PyUnicodeTranslateError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyValueError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyZeroDivisionError> for PyBaseExceptionObject` [src]

### `impl PyLayout<PanicException> for PyBaseExceptionObject` [src]

### `impl PyLayout<PyAny> for PyObject` [src]

### `impl PyLayout<PyModule> for PyObject` [src]

### `impl PyLayout<PyBool> for PyObject` [src]

### `impl PyLayout<PyByteArray> for PyObject` [src]

### `impl PyLayout<PyBytes> for PyObject` [src]

### `impl PyLayout<PyCFunction> for PyObject` [src]

### `impl PyLayout<PyComplex> for PyComplexObject` [src]

### `impl PyLayout<PyDate> for PyDateTime_Date` [src]

### `impl PyLayout<PyDateTime> for PyDateTime_DateTime` [src]

### `impl PyLayout<PyDelta> for PyDateTime_Delta` [src]

### `impl PyLayout<PyDict> for PyDictObject` [src]

### `impl PyLayout<PyFloat> for PyFloatObject` [src]

### `impl PyLayout<PyFrozenSet> for PySetObject` [src]

### `impl PyLayout<PyFunction> for PyObject` [src]

### `impl PyLayout<PyList> for PyObject` [src]

### `impl PyLayout<PyLong> for PyObject` [src]

### `impl PyLayout<PySet> for PySetObject` [src]

### `impl PyLayout<PySlice> for PySliceObject` [src]

### `impl PyLayout<PyString> for PyObject` [src]

### `impl PyLayout<PyTime> for PyDateTime_Time` [src]

### `impl PyLayout<PyTuple> for PyObject` [src]

### `impl PyLayout<PyType> for PyObject` [src]

### `impl PyLayout<PyTzInfo> for PyObject` [src]

### `impl<T: PyClass> PyLayout<T> for PyCell<T>` [src]

#### `const IS_NATIVE_TYPE: bool` [src]

#### `fn get_super(&mut self) -> Option<&mut T::BaseLayout>` [src]

#### `fn py_init(&mut self, value: T)` [src]

#### `unsafe fn py_drop(&mut self, py: Python<'_>)` [src]

Loading content...