Struct pyo3::PyObjectRef [−][src]
pub struct PyObjectRef(_);
Represents general python instance.
Trait Implementations
impl<U> PyTryInto<U> for PyObjectRef where
U: PyTryFrom,
[src]
impl<U> PyTryInto<U> for PyObjectRef where
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]
fn try_into(&self) -> Result<&U, U::Error>
Cast from PyObject to a concrete Python object type.
fn try_into_exact(&self) -> Result<&U, U::Error>
[src]
fn try_into_exact(&self) -> Result<&U, U::Error>
Cast from PyObject to a concrete Python object type. With exact type check.
fn try_into_mut(&self) -> Result<&mut U, U::Error>
[src]
fn try_into_mut(&self) -> Result<&mut U, U::Error>
Cast from PyObject to a concrete Python object type.
fn try_into_mut_exact(&self) -> Result<&mut U, U::Error>
[src]
fn try_into_mut_exact(&self) -> Result<&mut U, U::Error>
Cast from PyObject to a concrete Python object type. With exact type check.
impl AsPyRef<PyObjectRef> for PyObject
[src]
impl AsPyRef<PyObjectRef> for PyObject
fn as_ref(&self, _py: Python) -> &PyObjectRef
[src]
fn as_ref(&self, _py: Python) -> &PyObjectRef
Return reference to object.
fn as_mut(&self, _py: Python) -> &mut PyObjectRef
[src]
fn as_mut(&self, _py: Python) -> &mut PyObjectRef
Return mutable reference to object.
fn with<F, R>(&self, f: F) -> R where
F: FnOnce(Python, &T) -> R,
[src]
fn with<F, R>(&self, f: F) -> R where
F: FnOnce(Python, &T) -> R,
Acquire python gil and call closure with object reference.
fn with_mut<F, R>(&self, f: F) -> R where
F: FnOnce(Python, &mut T) -> R,
[src]
fn with_mut<F, R>(&self, f: F) -> R where
F: FnOnce(Python, &mut T) -> R,
Acquire python gil and call closure with mutable object reference.
fn into_py<F, R>(self, f: F) -> R where
Self: IntoPyPointer,
F: FnOnce(Python, &T) -> R,
[src]
fn into_py<F, R>(self, f: F) -> R where
Self: IntoPyPointer,
F: FnOnce(Python, &T) -> R,
fn into_mut_py<F, R>(self, f: F) -> R where
Self: IntoPyPointer,
F: FnOnce(Python, &mut T) -> R,
[src]
fn into_mut_py<F, R>(self, f: F) -> R where
Self: IntoPyPointer,
F: FnOnce(Python, &mut T) -> R,
impl<'a> From<&'a PyType> for &'a PyObjectRef
[src]
impl<'a> From<&'a PyType> for &'a PyObjectRef
impl AsRef<PyObjectRef> for PyType
[src]
impl AsRef<PyObjectRef> for PyType
fn as_ref(&self) -> &PyObjectRef
[src]
fn as_ref(&self) -> &PyObjectRef
Performs the conversion.
impl<'a> From<&'a PyModule> for &'a PyObjectRef
[src]
impl<'a> From<&'a PyModule> for &'a PyObjectRef
impl AsRef<PyObjectRef> for PyModule
[src]
impl AsRef<PyObjectRef> for PyModule
fn as_ref(&self) -> &PyObjectRef
[src]
fn as_ref(&self) -> &PyObjectRef
Performs the conversion.
impl<'a> From<&'a PyDict> for &'a PyObjectRef
[src]
impl<'a> From<&'a PyDict> for &'a PyObjectRef
impl AsRef<PyObjectRef> for PyDict
[src]
impl AsRef<PyObjectRef> for PyDict
fn as_ref(&self) -> &PyObjectRef
[src]
fn as_ref(&self) -> &PyObjectRef
Performs the conversion.
impl<'a> From<&'a PyBool> for &'a PyObjectRef
[src]
impl<'a> From<&'a PyBool> for &'a PyObjectRef
impl AsRef<PyObjectRef> for PyBool
[src]
impl AsRef<PyObjectRef> for PyBool
fn as_ref(&self) -> &PyObjectRef
[src]
fn as_ref(&self) -> &PyObjectRef
Performs the conversion.
impl<'source> TryFrom<&'source PyObjectRef> for bool
[src]
impl<'source> TryFrom<&'source PyObjectRef> for bool
type Error = PyErr
try_from
)The type returned in the event of a conversion error.
fn try_from(obj: &PyObjectRef) -> Result<Self, PyErr>
[src]
fn try_from(obj: &PyObjectRef) -> Result<Self, PyErr>
try_from
)Performs the conversion.
impl<'a> From<&'a PyByteArray> for &'a PyObjectRef
[src]
impl<'a> From<&'a PyByteArray> for &'a PyObjectRef
fn from(ob: &'a PyByteArray) -> Self
[src]
fn from(ob: &'a PyByteArray) -> Self
Performs the conversion.
impl AsRef<PyObjectRef> for PyByteArray
[src]
impl AsRef<PyObjectRef> for PyByteArray
fn as_ref(&self) -> &PyObjectRef
[src]
fn as_ref(&self) -> &PyObjectRef
Performs the conversion.
impl<'a> From<&'a PyTuple> for &'a PyObjectRef
[src]
impl<'a> From<&'a PyTuple> for &'a PyObjectRef
impl AsRef<PyObjectRef> for PyTuple
[src]
impl AsRef<PyObjectRef> for PyTuple
fn as_ref(&self) -> &PyObjectRef
[src]
fn as_ref(&self) -> &PyObjectRef
Performs the conversion.
impl<'a> From<&'a PyList> for &'a PyObjectRef
[src]
impl<'a> From<&'a PyList> for &'a PyObjectRef
impl AsRef<PyObjectRef> for PyList
[src]
impl AsRef<PyObjectRef> for PyList
fn as_ref(&self) -> &PyObjectRef
[src]
fn as_ref(&self) -> &PyObjectRef
Performs the conversion.
impl<'a> From<&'a PyFloat> for &'a PyObjectRef
[src]
impl<'a> From<&'a PyFloat> for &'a PyObjectRef
impl AsRef<PyObjectRef> for PyFloat
[src]
impl AsRef<PyObjectRef> for PyFloat
fn as_ref(&self) -> &PyObjectRef
[src]
fn as_ref(&self) -> &PyObjectRef
Performs the conversion.
impl<'source> TryFrom<&'source PyObjectRef> for f64
[src]
impl<'source> TryFrom<&'source PyObjectRef> for f64
type Error = PyErr
try_from
)The type returned in the event of a conversion error.
fn try_from(obj: &PyObjectRef) -> Result<Self, PyErr>
[src]
fn try_from(obj: &PyObjectRef) -> Result<Self, PyErr>
try_from
)Performs the conversion.
impl<'source> TryFrom<&'source PyObjectRef> for f32
[src]
impl<'source> TryFrom<&'source PyObjectRef> for f32
type Error = PyErr
try_from
)The type returned in the event of a conversion error.
fn try_from(obj: &PyObjectRef) -> Result<Self, PyErr>
[src]
fn try_from(obj: &PyObjectRef) -> Result<Self, PyErr>
try_from
)Performs the conversion.
impl AsRef<PyObjectRef> for PySequence
[src]
impl AsRef<PyObjectRef> for PySequence
fn as_ref(&self) -> &PyObjectRef
[src]
fn as_ref(&self) -> &PyObjectRef
Performs the conversion.
impl<'a> From<&'a PySlice> for &'a PyObjectRef
[src]
impl<'a> From<&'a PySlice> for &'a PyObjectRef
impl AsRef<PyObjectRef> for PySlice
[src]
impl AsRef<PyObjectRef> for PySlice
fn as_ref(&self) -> &PyObjectRef
[src]
fn as_ref(&self) -> &PyObjectRef
Performs the conversion.
impl<'source> TryFrom<&'source PyObjectRef> for String
[src]
impl<'source> TryFrom<&'source PyObjectRef> for String
type Error = PyErr
try_from
)The type returned in the event of a conversion error.
fn try_from(obj: &PyObjectRef) -> Result<Self, PyErr>
[src]
fn try_from(obj: &PyObjectRef) -> Result<Self, PyErr>
try_from
)Performs the conversion.
impl<'a> From<&'a PySet> for &'a PyObjectRef
[src]
impl<'a> From<&'a PySet> for &'a PyObjectRef
impl<'a> From<&'a PyFrozenSet> for &'a PyObjectRef
[src]
impl<'a> From<&'a PyFrozenSet> for &'a PyObjectRef
fn from(ob: &'a PyFrozenSet) -> Self
[src]
fn from(ob: &'a PyFrozenSet) -> Self
Performs the conversion.
impl AsRef<PyObjectRef> for PySet
[src]
impl AsRef<PyObjectRef> for PySet
fn as_ref(&self) -> &PyObjectRef
[src]
fn as_ref(&self) -> &PyObjectRef
Performs the conversion.
impl AsRef<PyObjectRef> for PyFrozenSet
[src]
impl AsRef<PyObjectRef> for PyFrozenSet
fn as_ref(&self) -> &PyObjectRef
[src]
fn as_ref(&self) -> &PyObjectRef
Performs the conversion.
impl<'a> From<&'a PyLong> for &'a PyObjectRef
[src]
impl<'a> From<&'a PyLong> for &'a PyObjectRef
impl AsRef<PyObjectRef> for PyLong
[src]
impl AsRef<PyObjectRef> for PyLong
fn as_ref(&self) -> &PyObjectRef
[src]
fn as_ref(&self) -> &PyObjectRef
Performs the conversion.
impl<'source> TryFrom<&'source PyObjectRef> for i8
[src]
impl<'source> TryFrom<&'source PyObjectRef> for i8
type Error = PyErr
try_from
)The type returned in the event of a conversion error.
fn try_from(obj: &PyObjectRef) -> Result<Self, PyErr>
[src]
fn try_from(obj: &PyObjectRef) -> Result<Self, PyErr>
try_from
)Performs the conversion.
impl<'source> TryFrom<&'source PyObjectRef> for u8
[src]
impl<'source> TryFrom<&'source PyObjectRef> for u8
type Error = PyErr
try_from
)The type returned in the event of a conversion error.
fn try_from(obj: &PyObjectRef) -> Result<Self, PyErr>
[src]
fn try_from(obj: &PyObjectRef) -> Result<Self, PyErr>
try_from
)Performs the conversion.
impl<'source> TryFrom<&'source PyObjectRef> for i16
[src]
impl<'source> TryFrom<&'source PyObjectRef> for i16
type Error = PyErr
try_from
)The type returned in the event of a conversion error.
fn try_from(obj: &PyObjectRef) -> Result<Self, PyErr>
[src]
fn try_from(obj: &PyObjectRef) -> Result<Self, PyErr>
try_from
)Performs the conversion.
impl<'source> TryFrom<&'source PyObjectRef> for u16
[src]
impl<'source> TryFrom<&'source PyObjectRef> for u16
type Error = PyErr
try_from
)The type returned in the event of a conversion error.
fn try_from(obj: &PyObjectRef) -> Result<Self, PyErr>
[src]
fn try_from(obj: &PyObjectRef) -> Result<Self, PyErr>
try_from
)Performs the conversion.
impl<'source> TryFrom<&'source PyObjectRef> for i32
[src]
impl<'source> TryFrom<&'source PyObjectRef> for i32
type Error = PyErr
try_from
)The type returned in the event of a conversion error.
fn try_from(obj: &PyObjectRef) -> Result<Self, PyErr>
[src]
fn try_from(obj: &PyObjectRef) -> Result<Self, PyErr>
try_from
)Performs the conversion.
impl<'source> TryFrom<&'source PyObjectRef> for u32
[src]
impl<'source> TryFrom<&'source PyObjectRef> for u32
type Error = PyErr
try_from
)The type returned in the event of a conversion error.
fn try_from(obj: &PyObjectRef) -> Result<Self, PyErr>
[src]
fn try_from(obj: &PyObjectRef) -> Result<Self, PyErr>
try_from
)Performs the conversion.
impl<'source> TryFrom<&'source PyObjectRef> for i64
[src]
impl<'source> TryFrom<&'source PyObjectRef> for i64
type Error = PyErr
try_from
)The type returned in the event of a conversion error.
fn try_from(obj: &PyObjectRef) -> Result<Self, PyErr>
[src]
fn try_from(obj: &PyObjectRef) -> Result<Self, PyErr>
try_from
)Performs the conversion.
impl<'source> TryFrom<&'source PyObjectRef> for isize
[src]
impl<'source> TryFrom<&'source PyObjectRef> for isize
type Error = PyErr
try_from
)The type returned in the event of a conversion error.
fn try_from(obj: &PyObjectRef) -> Result<Self, PyErr>
[src]
fn try_from(obj: &PyObjectRef) -> Result<Self, PyErr>
try_from
)Performs the conversion.
impl<'source> TryFrom<&'source PyObjectRef> for usize
[src]
impl<'source> TryFrom<&'source PyObjectRef> for usize
type Error = PyErr
try_from
)The type returned in the event of a conversion error.
fn try_from(obj: &PyObjectRef) -> Result<Self, PyErr>
[src]
fn try_from(obj: &PyObjectRef) -> Result<Self, PyErr>
try_from
)Performs the conversion.
impl<'a> From<&'a PyString> for &'a PyObjectRef
[src]
impl<'a> From<&'a PyString> for &'a PyObjectRef
impl AsRef<PyObjectRef> for PyString
[src]
impl AsRef<PyObjectRef> for PyString
fn as_ref(&self) -> &PyObjectRef
[src]
fn as_ref(&self) -> &PyObjectRef
Performs the conversion.
impl<'a> From<&'a PyBytes> for &'a PyObjectRef
[src]
impl<'a> From<&'a PyBytes> for &'a PyObjectRef
impl AsRef<PyObjectRef> for PyBytes
[src]
impl AsRef<PyObjectRef> for PyBytes
fn as_ref(&self) -> &PyObjectRef
[src]
fn as_ref(&self) -> &PyObjectRef
Performs the conversion.
impl AsRef<PyObjectRef> for PyObjectRef
[src]
impl AsRef<PyObjectRef> for PyObjectRef
fn as_ref(&self) -> &PyObjectRef
[src]
fn as_ref(&self) -> &PyObjectRef
Performs the conversion.
impl PyObjectWithToken for PyObjectRef
[src]
impl PyObjectWithToken for PyObjectRef
impl ToPyPointer for PyObjectRef
[src]
impl ToPyPointer for PyObjectRef
impl PartialEq for PyObjectRef
[src]
impl PartialEq for PyObjectRef
fn eq(&self, o: &PyObjectRef) -> bool
[src]
fn eq(&self, o: &PyObjectRef) -> bool
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]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl PyTypeInfo for PyObjectRef
[src]
impl PyTypeInfo for PyObjectRef
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]
unsafe fn type_object() -> &'static mut PyTypeObject
PyTypeObject instance for this type
fn is_instance(ptr: *mut PyObject) -> bool
[src]
fn is_instance(ptr: *mut PyObject) -> bool
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]
fn is_exact_instance(ptr: *mut PyObject) -> bool
Check if *mut ffi::PyObject
is exact instance of this type
impl PyTypeObject for PyObjectRef
[src]
impl PyTypeObject for PyObjectRef
fn init_type()
[src]
fn init_type()
Initialize type object
fn type_object() -> Py<PyType>
[src]
fn type_object() -> Py<PyType>
Retrieves the type object for this Python object type.
fn create(py: Python) -> PyResult<PyRawObject> where
Self: Sized + PyObjectAlloc<Self> + PyTypeInfo,
[src]
fn create(py: Python) -> PyResult<PyRawObject> where
Self: Sized + PyObjectAlloc<Self> + PyTypeInfo,
Create PyRawObject which can be initialized with rust value
impl ToPyObject for PyObjectRef
[src]
impl ToPyObject for PyObjectRef
impl ToBorrowedObject for PyObjectRef
[src]
impl ToBorrowedObject for PyObjectRef
fn with_borrowed_ptr<F, R>(&self, _py: Python, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
fn with_borrowed_ptr<F, R>(&self, _py: Python, f: F) -> R where
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]
impl Debug for PyObjectRef
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl Display for PyObjectRef
[src]
impl Display for PyObjectRef
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl<'a> FromPyObject<'a> for &'a PyObjectRef
[src]
impl<'a> FromPyObject<'a> for &'a PyObjectRef
fn extract(ob: &'a PyObjectRef) -> PyResult<Self>
[src]
fn extract(ob: &'a PyObjectRef) -> PyResult<Self>
Extracts Self
from the source PyObject
.
Auto Trait Implementations
impl Send for PyObjectRef
impl Send for PyObjectRef
impl Sync for PyObjectRef
impl Sync for PyObjectRef