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
sourceimpl FromPyObject<'_> for PyNone
impl FromPyObject<'_> for PyNone
sourceimpl Ord for PyNone
impl Ord for PyNone
1.21.0 · sourceconst fn max(self, other: Self) -> Selfwhere
Self: Sized,
const fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourceconst fn min(self, other: Self) -> Selfwhere
Self: Sized,
const fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourceconst fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
const fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<PyNone> for PyNone
impl PartialOrd<PyNone> for PyNone
sourcefn partial_cmp(&self, other: &PyNone) -> Option<Ordering>
fn partial_cmp(&self, other: &PyNone) -> Option<Ordering>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
const 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 moresourceimpl ToPyObject for PyNone
impl ToPyObject for PyNone
type ObjectType = PyObject
sourcefn to_py_object(&self, py: Python<'_>) -> PyObject
fn to_py_object(&self, py: Python<'_>) -> PyObject
Converts self into a Python object.
sourcefn 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 StructuralEq for PyNone
impl StructuralPartialEq for PyNone
Auto Trait Implementations
impl RefUnwindSafe for PyNone
impl Send for PyNone
impl Sync for PyNone
impl Unpin for PyNone
impl UnwindSafe for PyNone
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more