Struct cpython::PyInt [−][src]
pub struct PyInt(_);Expand description
In Python 2.x, represents a Python long object.
In Python 3.x, represents a Python int object.
Both PyInt and PyLong refer to the same type on Python 3.x.
You can usually avoid directly working with this type by using ToPyObject and extract with the primitive Rust integer types.
Trait Implementations
Unchecked downcast from PyObject to Self. Undefined behavior if the input object does not have the expected type.
Unchecked downcast from PyObject to Self. Undefined behavior if the input object does not have the expected type.
Casts the Python object to PyObject.
fn downcast_from<'p>(
py: Python<'p>,
obj: PyObject
) -> Result<PyLong, PythonObjectDowncastError<'p>>
fn downcast_from<'p>(
py: Python<'p>,
obj: PyObject
) -> Result<PyLong, PythonObjectDowncastError<'p>>
Cast from PyObject to a concrete Python object type.
fn downcast_borrow_from<'a, 'p>(
py: Python<'p>,
obj: &'a PyObject
) -> Result<&'a PyLong, PythonObjectDowncastError<'p>>
fn downcast_borrow_from<'a, 'p>(
py: Python<'p>,
obj: &'a PyObject
) -> Result<&'a PyLong, PythonObjectDowncastError<'p>>
Cast from PyObject to a concrete Python object type.
Retrieves the type object for this Python object type.
Identity conversion: allows using existing PyObject instances where
T: ToPyObject is expected.
type ObjectType = PyLong
Converts self into a Python object.
Converts self into a Python object. Read more