Struct pyo3::PyObject [] [src]

pub struct PyObject(_);

Safe wrapper around unsafe *mut ffi::PyObject pointer.

Methods

impl PyObject
[src]

[src]

Creates a PyObject instance for the given FFI pointer. This moves ownership over the pointer into the PyObject. Undefined behavior if the pointer is NULL or invalid.

[src]

Creates a PyObject instance for the given FFI pointer. Panics if the pointer is null. Undefined behavior if the pointer is invalid.

[src]

Construct PyObject from the result of a Python FFI call that returns a new reference (owned pointer). Returns Err(PyErr) if the pointer is null.

[src]

Construct PyObject from the result of a Python FFI call that returns a new reference (owned pointer). Returns None if the pointer is null.

[src]

Creates a PyObject instance for the given Python FFI pointer. Calls Py_INCREF() on the ptr. Undefined behavior if the pointer is NULL or invalid.

[src]

Creates a PyObject instance for the given Python FFI pointer. Calls Py_INCREF() on the ptr. Returns Err(PyErr) if the pointer is null.

[src]

Creates a PyObject instance for the given Python FFI pointer. Calls Py_INCREF() on the ptr. Returns None if the pointer is null.

[src]

Gets the reference count of the ffi::PyObject pointer.

[src]

Clone self, Calls Py_INCREF() on the ptr.

[src]

Returns whether the object is considered to be None. This is equivalent to the Python expression: 'is None'

[src]

Returns whether the object is considered to be true. This is equivalent to the Python expression: 'not not self'

[src]

Casts the PyObject to a concrete Python object type.

[src]

Extracts some type from the Python object. This is a wrapper function around FromPyObject::extract().

[src]

Retrieves an attribute value. This is equivalent to the Python expression 'self.attr_name'.

[src]

Calls the object. This is equivalent to the Python expression: 'self(*args, **kwargs)'

[src]

Calls the object without arguments. This is equivalent to the Python expression: 'self()'

[src]

Calls the object. This is equivalent to the Python expression: 'self(*args)'

[src]

Calls a method on the object. This is equivalent to the Python expression: 'self.name(*args, **kwargs)'

[src]

Calls a method on the object. This is equivalent to the Python expression: 'self.name()'

[src]

Calls a method on the object. This is equivalent to the Python expression: 'self.name(*args)'

Trait Implementations

impl<T> From<Py<T>> for PyObject
[src]

[src]

Performs the conversion.

impl<'a, T> From<&'a T> for PyObject where
    T: ToPyPointer
[src]

[src]

Performs the conversion.

impl<'a, T> From<&'a mut T> for PyObject where
    T: ToPyPointer
[src]

[src]

Performs the conversion.

impl Debug for PyObject
[src]

[src]

Formats the value using the given formatter. Read more

impl Send for PyObject
[src]

impl Sync for PyObject
[src]

impl AsPyRef<PyObjectRef> for PyObject
[src]

[src]

Return reference to object.

[src]

Return mutable reference to object.

[src]

Acquire python gil and call closure with object reference.

[src]

Acquire python gil and call closure with mutable object reference.

[src]

[src]

impl ToPyObject for PyObject
[src]

[src]

Converts self into a Python object.

impl ToBorrowedObject for PyObject
[src]

[src]

Converts self into a Python object and calls the specified closure on the native FFI pointer underlying the Python object. Read more

impl ToPyPointer for PyObject
[src]

[src]

Gets the underlying FFI pointer, returns a borrowed pointer.

impl<'a> ToPyPointer for &'a PyObject
[src]

[src]

Gets the underlying FFI pointer, returns a borrowed pointer.

impl IntoPyPointer for PyObject
[src]

[src]

Gets the underlying FFI pointer, returns a owned pointer.

impl PartialEq for PyObject
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl IntoPyObject for PyObject
[src]

[src]

Converts self into a Python object. (Consumes self)

impl<'a> FromPyObject<'a> for PyObject
[src]

[src]

Extracts Self from the source PyObject.

impl Drop for PyObject
[src]

Dropping a PyObject instance decrements the reference count on the object by 1.

[src]

Executes the destructor for this type. Read more

Auto Trait Implementations