pub struct PyNone;
Expand description
An empty struct that represents None
in Python.
This can be used as a function return type for functions that should return
None
in Python.
§Example
use cpython::{Python, PyResult, PyNone};
fn example(py: Python) -> PyResult<PyNone> {
Ok(PyNone)
}
Trait Implementations§
source§impl FromPyObject<'_> for PyNone
impl FromPyObject<'_> for PyNone
source§impl Ord for PyNone
impl Ord for PyNone
source§impl PartialEq for PyNone
impl PartialEq for PyNone
source§impl PartialOrd for PyNone
impl PartialOrd for PyNone
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl ToPyObject for PyNone
impl ToPyObject for PyNone
type ObjectType = PyObject
source§fn to_py_object(&self, py: Python<'_>) -> PyObject
fn to_py_object(&self, py: Python<'_>) -> PyObject
Converts self into a Python object.
source§fn into_py_object(self, py: Python<'_>) -> Self::ObjectTypewhere
Self: Sized,
fn into_py_object(self, py: Python<'_>) -> Self::ObjectTypewhere
Self: Sized,
Converts self into a Python object. Read more
impl Copy for PyNone
impl Eq for PyNone
impl StructuralPartialEq for PyNone
Auto Trait Implementations§
impl Freeze for PyNone
impl RefUnwindSafe for PyNone
impl Send for PyNone
impl Sync for PyNone
impl Unpin for PyNone
impl UnwindSafe for PyNone
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more