[][src]Struct cpython::PyFloat

pub struct PyFloat(_);

Represents a Python float object.

You can usually avoid directly working with this type by using ToPyObject and extract with f32/f64.

Methods

impl PyFloat[src]

pub fn new(py: Python, val: c_double) -> PyFloat[src]

Creates a new Python float object.

pub fn value(&self, _py: Python) -> c_double[src]

Gets the value of this float.

Trait Implementations

impl PythonObject for PyFloat[src]

unsafe fn unchecked_downcast_from(obj: PyObject) -> Self[src]

Unchecked downcast from PyObject to Self. Undefined behavior if the input object does not have the expected type.

unsafe fn unchecked_downcast_borrow_from<'a>(obj: &'a PyObject) -> &'a Self[src]

Unchecked downcast from PyObject to Self. Undefined behavior if the input object does not have the expected type.

impl PythonObjectWithCheckedDowncast for PyFloat[src]

impl PythonObjectWithTypeObject for PyFloat[src]

impl ToPyObject for PyFloat[src]

Identity conversion: allows using existing PyObject instances where T: ToPyObject is expected.

type ObjectType = PyFloat

impl<'source> FromPyObject<'source> for PyFloat[src]

impl<'source> FromPyObject<'source> for &'source PyFloat[src]

Auto Trait Implementations

impl Sync for PyFloat

impl Send for PyFloat

impl Unpin for PyFloat

impl RefUnwindSafe for PyFloat

impl UnwindSafe for PyFloat

Blanket Implementations

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]