Struct pyo3::PyObjectRef
[−]
[src]
pub struct PyObjectRef(_);
Represents general python instance.
Trait Implementations
impl<U> PyTryInto<U> for PyObjectRef where
U: PyTryFrom,
[src]
U: PyTryFrom,
type Error = U::Error
The type returned in the event of a conversion error.
fn try_into(&self) -> Result<&U, U::Error>
[src]
Cast from PyObject to a concrete Python object type.
fn try_into_exact(&self) -> Result<&U, U::Error>
[src]
Cast from PyObject to a concrete Python object type. With exact type check.
fn try_into_mut(&self) -> Result<&mut U, U::Error>
[src]
Cast from PyObject to a concrete Python object type.
fn try_into_mut_exact(&self) -> Result<&mut U, U::Error>
[src]
Cast from PyObject to a concrete Python object type. With exact type check.
impl<'a> From<&'a PyType> for &'a PyObjectRef
[src]
impl<'a> From<&'a PyModule> for &'a PyObjectRef
[src]
impl<'a> From<&'a PyDict> for &'a PyObjectRef
[src]
impl<'a> From<&'a PyBool> for &'a PyObjectRef
[src]
impl<'a> From<&'a PyByteArray> for &'a PyObjectRef
[src]
fn from(ob: &'a PyByteArray) -> Self
[src]
Performs the conversion.
impl<'a> From<&'a PyTuple> for &'a PyObjectRef
[src]
impl<'a> From<&'a PyList> for &'a PyObjectRef
[src]
impl<'a> From<&'a PyFloat> for &'a PyObjectRef
[src]
impl<'a> From<&'a PySlice> for &'a PyObjectRef
[src]
impl<'a> From<&'a PySet> for &'a PyObjectRef
[src]
impl<'a> From<&'a PyFrozenSet> for &'a PyObjectRef
[src]
fn from(ob: &'a PyFrozenSet) -> Self
[src]
Performs the conversion.
impl<'a> From<&'a PyLong> for &'a PyObjectRef
[src]
impl<'a> From<&'a PyString> for &'a PyObjectRef
[src]
impl<'a> From<&'a PyBytes> for &'a PyObjectRef
[src]
impl AsRef<PyObjectRef> for PyObjectRef
[src]
fn as_ref(&self) -> &PyObjectRef
[src]
Performs the conversion.
impl PyObjectWithToken for PyObjectRef
[src]
impl ToPyPointer for PyObjectRef
[src]
impl PartialEq for PyObjectRef
[src]
fn eq(&self, o: &PyObjectRef) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl PyTypeInfo for PyObjectRef
[src]
type Type = ()
Type of objects to store in PyObject struct
type BaseType = PyObjectRef
Base class
const NAME: &'static str
NAME: &'static str = "PyObjectRef"
Class name
const SIZE: usize
SIZE: usize = ::std::mem::size_of::<::ffi::PyObject>()
Size of the rust PyObject structure (PyObject + rust structure)
const OFFSET: isize
OFFSET: isize = 0
Type
instance offset inside PyObject structure
unsafe fn type_object() -> &'static mut PyTypeObject
[src]
PyTypeObject instance for this type
fn is_instance(ptr: *mut PyObject) -> bool
[src]
Check if *mut ffi::PyObject
is instance of this type
const DESCRIPTION: &'static str
DESCRIPTION: &'static str = "\u{0}"
Class doc string
const FLAGS: usize
FLAGS: usize = 0
Type flags (ie PY_TYPE_FLAG_GC, PY_TYPE_FLAG_WEAKREF)
fn is_exact_instance(ptr: *mut PyObject) -> bool
[src]
Check if *mut ffi::PyObject
is exact instance of this type
impl PyTypeObject for PyObjectRef
[src]
fn init_type()
[src]
Initialize type object
fn type_object() -> Py<PyType>
[src]
Retrieves the type object for this Python object type.
fn create(py: Python) -> PyResult<PyRawObject> where
Self: Sized + PyObjectAlloc<Self> + PyTypeInfo,
[src]
Self: Sized + PyObjectAlloc<Self> + PyTypeInfo,
Create PyRawObject which can be initialized with rust value
impl ToPyObject for PyObjectRef
[src]
impl ToBorrowedObject for PyObjectRef
[src]
fn with_borrowed_ptr<F, R>(&self, _py: Python, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
Converts self into a Python object and calls the specified closure on the native FFI pointer underlying the Python object. Read more
impl Debug for PyObjectRef
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter.
impl Display for PyObjectRef
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter. Read more
impl<'a> FromPyObject<'a> for &'a PyObjectRef
[src]
fn extract(ob: &'a PyObjectRef) -> PyResult<Self>
[src]
Extracts Self
from the source PyObject
.