[][src]Trait pyo3::type_object::PyTypeInfo

pub trait PyTypeInfo: Sized {
    type Type;
    type BaseType: PyTypeInfo + PyTypeObject;
    type ConcreteLayout: PyObjectLayout<Self>;
    type Initializer: PyObjectInit<Self>;

    const NAME: &'static str;
    const MODULE: Option<&'static str>;
    const DESCRIPTION: &'static str;
    const FLAGS: usize;

    unsafe fn type_object() -> &'static mut PyTypeObject;

    fn is_instance(object: &PyAny) -> bool { ... }
fn is_exact_instance(object: &PyAny) -> bool { ... } }

Python type information. All Python native types(e.g., PyDict) and #[pyclass] structs implement this trait.

Associated Types

type Type

Type of objects to store in PyObject struct

type BaseType: PyTypeInfo + PyTypeObject

Base class

type ConcreteLayout: PyObjectLayout<Self>

Layout

type Initializer: PyObjectInit<Self>

Initializer for layout

Loading content...

Associated Constants

const NAME: &'static str

Class name

const MODULE: Option<&'static str>

Module name, if any

const DESCRIPTION: &'static str

Class doc string

const FLAGS: usize

Type flags (ie PY_TYPE_FLAG_GC, PY_TYPE_FLAG_WEAKREF)

Loading content...

Required methods

unsafe fn type_object() -> &'static mut PyTypeObject

PyTypeObject instance for this type, which might still need to be initialized

Loading content...

Provided methods

fn is_instance(object: &PyAny) -> bool

Check if *mut ffi::PyObject is instance of this type

fn is_exact_instance(object: &PyAny) -> bool

Check if *mut ffi::PyObject is exact instance of this type

Loading content...

Implementors

impl PyTypeInfo for PyModule[src]

type Type = ()

type BaseType = PyAny

type ConcreteLayout = PyObject

type Initializer = PyNativeTypeInitializer<Self>

impl PyTypeInfo for PyAny[src]

type Type = ()

type BaseType = PyAny

type ConcreteLayout = PyObject

type Initializer = PyNativeTypeInitializer<Self>

impl PyTypeInfo for PyBool[src]

type Type = ()

type BaseType = PyAny

type ConcreteLayout = PyObject

type Initializer = PyNativeTypeInitializer<Self>

impl PyTypeInfo for PyByteArray[src]

type Type = ()

type BaseType = PyAny

type ConcreteLayout = PyObject

type Initializer = PyNativeTypeInitializer<Self>

impl PyTypeInfo for PyBytes[src]

type Type = ()

type BaseType = PyAny

type ConcreteLayout = PyObject

type Initializer = PyNativeTypeInitializer<Self>

impl PyTypeInfo for PyComplex[src]

type Type = ()

type BaseType = PyAny

type ConcreteLayout = PyComplexObject

type Initializer = PyNativeTypeInitializer<Self>

impl PyTypeInfo for PyDate[src]

type Type = ()

type BaseType = PyAny

type ConcreteLayout = PyDateTime_Date

type Initializer = PyNativeTypeInitializer<Self>

impl PyTypeInfo for PyDateTime[src]

type Type = ()

type BaseType = PyAny

type ConcreteLayout = PyDateTime_DateTime

type Initializer = PyNativeTypeInitializer<Self>

impl PyTypeInfo for PyDelta[src]

type Type = ()

type BaseType = PyAny

type ConcreteLayout = PyDateTime_Delta

type Initializer = PyNativeTypeInitializer<Self>

impl PyTypeInfo for PyDict[src]

type Type = ()

type BaseType = PyAny

type ConcreteLayout = PyDictObject

type Initializer = PyNativeTypeInitializer<Self>

impl PyTypeInfo for PyFloat[src]

type Type = ()

type BaseType = PyAny

type ConcreteLayout = PyFloatObject

type Initializer = PyNativeTypeInitializer<Self>

impl PyTypeInfo for PyFrozenSet[src]

type Type = ()

type BaseType = PyAny

type ConcreteLayout = PySetObject

type Initializer = PyNativeTypeInitializer<Self>

impl PyTypeInfo for PyList[src]

type Type = ()

type BaseType = PyAny

type ConcreteLayout = PyObject

type Initializer = PyNativeTypeInitializer<Self>

impl PyTypeInfo for PyLong[src]

type Type = ()

type BaseType = PyAny

type ConcreteLayout = PyObject

type Initializer = PyNativeTypeInitializer<Self>

impl PyTypeInfo for PySet[src]

type Type = ()

type BaseType = PyAny

type ConcreteLayout = PySetObject

type Initializer = PyNativeTypeInitializer<Self>

impl PyTypeInfo for PySlice[src]

type Type = ()

type BaseType = PyAny

type ConcreteLayout = PySliceObject

type Initializer = PyNativeTypeInitializer<Self>

impl PyTypeInfo for PyString[src]

type Type = ()

type BaseType = PyAny

type ConcreteLayout = PyObject

type Initializer = PyNativeTypeInitializer<Self>

impl PyTypeInfo for PyTime[src]

type Type = ()

type BaseType = PyAny

type ConcreteLayout = PyDateTime_Time

type Initializer = PyNativeTypeInitializer<Self>

impl PyTypeInfo for PyTuple[src]

type Type = ()

type BaseType = PyAny

type ConcreteLayout = PyObject

type Initializer = PyNativeTypeInitializer<Self>

impl PyTypeInfo for PyType[src]

type Type = ()

type BaseType = PyAny

type ConcreteLayout = PyObject

type Initializer = PyNativeTypeInitializer<Self>

impl PyTypeInfo for PyTzInfo[src]

type Type = ()

type BaseType = PyAny

type ConcreteLayout = PyObject

type Initializer = PyNativeTypeInitializer<Self>

Loading content...