[][src]Trait pyo3::typeob::PyTypeInfo

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

    const NAME: &'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: &PyObjectRef) -> bool { ... }
fn is_exact_instance(object: &PyObjectRef) -> 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 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: &PyObjectRef) -> bool

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

fn is_exact_instance(object: &PyObjectRef) -> bool

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

Loading content...

Implementors

impl PyTypeInfo for PyModule[src]

type Type = ()

type BaseType = PyObjectRef

const DESCRIPTION: &'static str[src]

const FLAGS: usize[src]

fn is_exact_instance(object: &PyObjectRef) -> bool[src]

impl PyTypeInfo for PyBool[src]

type Type = ()

type BaseType = PyObjectRef

const DESCRIPTION: &'static str[src]

const FLAGS: usize[src]

fn is_exact_instance(object: &PyObjectRef) -> bool[src]

impl PyTypeInfo for PyByteArray[src]

type Type = ()

type BaseType = PyObjectRef

const DESCRIPTION: &'static str[src]

const FLAGS: usize[src]

fn is_exact_instance(object: &PyObjectRef) -> bool[src]

impl PyTypeInfo for PyBytes[src]

type Type = ()

type BaseType = PyObjectRef

const DESCRIPTION: &'static str[src]

const FLAGS: usize[src]

fn is_exact_instance(object: &PyObjectRef) -> bool[src]

impl PyTypeInfo for PyComplex[src]

type Type = ()

type BaseType = PyObjectRef

const DESCRIPTION: &'static str[src]

const FLAGS: usize[src]

fn is_exact_instance(object: &PyObjectRef) -> bool[src]

impl PyTypeInfo for PyDate[src]

type Type = ()

type BaseType = PyObjectRef

const DESCRIPTION: &'static str[src]

const FLAGS: usize[src]

fn is_exact_instance(object: &PyObjectRef) -> bool[src]

impl PyTypeInfo for PyDateTime[src]

type Type = ()

type BaseType = PyObjectRef

const DESCRIPTION: &'static str[src]

const FLAGS: usize[src]

fn is_exact_instance(object: &PyObjectRef) -> bool[src]

impl PyTypeInfo for PyDelta[src]

type Type = ()

type BaseType = PyObjectRef

const DESCRIPTION: &'static str[src]

const FLAGS: usize[src]

fn is_exact_instance(object: &PyObjectRef) -> bool[src]

impl PyTypeInfo for PyDict[src]

type Type = ()

type BaseType = PyObjectRef

const DESCRIPTION: &'static str[src]

const FLAGS: usize[src]

fn is_exact_instance(object: &PyObjectRef) -> bool[src]

impl PyTypeInfo for PyFloat[src]

type Type = ()

type BaseType = PyObjectRef

const DESCRIPTION: &'static str[src]

const FLAGS: usize[src]

fn is_exact_instance(object: &PyObjectRef) -> bool[src]

impl PyTypeInfo for PyFrozenSet[src]

type Type = ()

type BaseType = PyObjectRef

const DESCRIPTION: &'static str[src]

const FLAGS: usize[src]

fn is_exact_instance(object: &PyObjectRef) -> bool[src]

impl PyTypeInfo for PyList[src]

type Type = ()

type BaseType = PyObjectRef

const DESCRIPTION: &'static str[src]

const FLAGS: usize[src]

fn is_exact_instance(object: &PyObjectRef) -> bool[src]

impl PyTypeInfo for PyLong[src]

type Type = ()

type BaseType = PyObjectRef

const DESCRIPTION: &'static str[src]

const FLAGS: usize[src]

fn is_exact_instance(object: &PyObjectRef) -> bool[src]

impl PyTypeInfo for PyObjectRef[src]

type Type = ()

type BaseType = PyObjectRef

const DESCRIPTION: &'static str[src]

const FLAGS: usize[src]

fn is_exact_instance(object: &PyObjectRef) -> bool[src]

impl PyTypeInfo for PySet[src]

type Type = ()

type BaseType = PyObjectRef

const DESCRIPTION: &'static str[src]

const FLAGS: usize[src]

fn is_exact_instance(object: &PyObjectRef) -> bool[src]

impl PyTypeInfo for PySlice[src]

type Type = ()

type BaseType = PyObjectRef

const DESCRIPTION: &'static str[src]

const FLAGS: usize[src]

fn is_exact_instance(object: &PyObjectRef) -> bool[src]

impl PyTypeInfo for PyString[src]

type Type = ()

type BaseType = PyObjectRef

const DESCRIPTION: &'static str[src]

const FLAGS: usize[src]

fn is_exact_instance(object: &PyObjectRef) -> bool[src]

impl PyTypeInfo for PyTime[src]

type Type = ()

type BaseType = PyObjectRef

const DESCRIPTION: &'static str[src]

const FLAGS: usize[src]

fn is_exact_instance(object: &PyObjectRef) -> bool[src]

impl PyTypeInfo for PyTuple[src]

type Type = ()

type BaseType = PyObjectRef

const DESCRIPTION: &'static str[src]

const FLAGS: usize[src]

fn is_exact_instance(object: &PyObjectRef) -> bool[src]

impl PyTypeInfo for PyType[src]

type Type = ()

type BaseType = PyObjectRef

const DESCRIPTION: &'static str[src]

const FLAGS: usize[src]

fn is_exact_instance(object: &PyObjectRef) -> bool[src]

impl PyTypeInfo for PyTzInfo[src]

type Type = ()

type BaseType = PyObjectRef

const DESCRIPTION: &'static str[src]

const FLAGS: usize[src]

fn is_exact_instance(object: &PyObjectRef) -> bool[src]

Loading content...