Trait pyo3::typeob::PyTypeInfo [−][src]
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(ptr: *mut PyObject) -> bool { ... } fn is_exact_instance(ptr: *mut PyObject) -> bool { ... } }
Python type information.
Associated Types
Associated Constants
const NAME: &'static str
Class name
const DESCRIPTION: &'static str
DESCRIPTION: &'static str = "\u{0}"
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
FLAGS: usize = 0
Type flags (ie PY_TYPE_FLAG_GC, PY_TYPE_FLAG_WEAKREF)
Required Methods
unsafe fn type_object() -> &'static mut PyTypeObject
PyTypeObject instance for this type
Provided Methods
fn is_instance(ptr: *mut PyObject) -> bool
Check if *mut ffi::PyObject
is instance of this type
fn is_exact_instance(ptr: *mut PyObject) -> bool
Check if *mut ffi::PyObject
is exact instance of this type
Implementations on Foreign Types
impl<'a, T: ?Sized> PyTypeInfo for &'a T where
T: PyTypeInfo,
[src]
impl<'a, T: ?Sized> PyTypeInfo for &'a T where
T: PyTypeInfo,
type Type = T::Type
type BaseType = T::BaseType
const NAME: &'static str
const DESCRIPTION: &'static str
const SIZE: usize
const OFFSET: isize
const FLAGS: usize
unsafe fn type_object() -> &'static mut PyTypeObject
[src]
unsafe fn type_object() -> &'static mut PyTypeObject
fn is_instance(ptr: *mut PyObject) -> bool
[src]
fn is_instance(ptr: *mut PyObject) -> bool
fn is_exact_instance(ptr: *mut PyObject) -> bool
[src]
fn is_exact_instance(ptr: *mut PyObject) -> bool
Implementors
impl PyTypeInfo for PyType type Type = (); type BaseType = PyObjectRef;
impl PyTypeInfo for PyModule type Type = (); type BaseType = PyObjectRef;
impl PyTypeInfo for PyDict type Type = (); type BaseType = PyObjectRef;
impl PyTypeInfo for PyBool type Type = (); type BaseType = PyObjectRef;
impl PyTypeInfo for PyByteArray type Type = (); type BaseType = PyObjectRef;
impl PyTypeInfo for PyTuple type Type = (); type BaseType = PyObjectRef;
impl PyTypeInfo for PyList type Type = (); type BaseType = PyObjectRef;
impl PyTypeInfo for PyFloat type Type = (); type BaseType = PyObjectRef;
impl PyTypeInfo for PySlice type Type = (); type BaseType = PyObjectRef;
impl PyTypeInfo for PySet type Type = (); type BaseType = PyObjectRef;
impl PyTypeInfo for PyFrozenSet type Type = (); type BaseType = PyObjectRef;
impl PyTypeInfo for PyLong type Type = (); type BaseType = PyObjectRef;
impl PyTypeInfo for PyString type Type = (); type BaseType = PyObjectRef;
impl PyTypeInfo for PyBytes type Type = (); type BaseType = PyObjectRef;
impl PyTypeInfo for PyObjectRef type Type = (); type BaseType = PyObjectRef;