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

pub trait PyTypeInfo {
    type Type;
    type BaseType: PyTypeInfo;

    const NAME: &'static str;
    const MODULE: Option<&'static str>;
    const DESCRIPTION: &'static str;
    const SIZE: usize;
    const OFFSET: isize;
    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.

Associated Types

type Type

Type of objects to store in PyObject struct

type BaseType: PyTypeInfo

Base class

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 SIZE: usize

Size of the rust PyObject structure (PyObject + rust structure)

const OFFSET: isize

Type instance offset inside PyObject structure

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

impl PyTypeInfo for PyAny[src]

type Type = ()

type BaseType = PyAny

impl PyTypeInfo for PyBool[src]

type Type = ()

type BaseType = PyAny

impl PyTypeInfo for PyByteArray[src]

type Type = ()

type BaseType = PyAny

impl PyTypeInfo for PyBytes[src]

type Type = ()

type BaseType = PyAny

impl PyTypeInfo for PyComplex[src]

type Type = ()

type BaseType = PyAny

impl PyTypeInfo for PyDate[src]

type Type = ()

type BaseType = PyAny

impl PyTypeInfo for PyDateTime[src]

type Type = ()

type BaseType = PyAny

impl PyTypeInfo for PyDelta[src]

type Type = ()

type BaseType = PyAny

impl PyTypeInfo for PyDict[src]

type Type = ()

type BaseType = PyAny

impl PyTypeInfo for PyFloat[src]

type Type = ()

type BaseType = PyAny

impl PyTypeInfo for PyFrozenSet[src]

type Type = ()

type BaseType = PyAny

impl PyTypeInfo for PyList[src]

type Type = ()

type BaseType = PyAny

impl PyTypeInfo for PyLong[src]

type Type = ()

type BaseType = PyAny

impl PyTypeInfo for PySet[src]

type Type = ()

type BaseType = PyAny

impl PyTypeInfo for PySlice[src]

type Type = ()

type BaseType = PyAny

impl PyTypeInfo for PyString[src]

type Type = ()

type BaseType = PyAny

impl PyTypeInfo for PyTime[src]

type Type = ()

type BaseType = PyAny

impl PyTypeInfo for PyTuple[src]

type Type = ()

type BaseType = PyAny

impl PyTypeInfo for PyType[src]

type Type = ()

type BaseType = PyAny

impl PyTypeInfo for PyTzInfo[src]

type Type = ()

type BaseType = PyAny

Loading content...