Struct cpython::PyBool[][src]

pub struct PyBool(_);

Represents a Python bool.

Implementations

impl PyBool[src]

pub fn get(py: Python<'_>, val: bool) -> PyBool[src]

Depending on val, returns py.True() or py.False().

pub fn is_true(&self) -> bool[src]

Gets whether this boolean is true.

Trait Implementations

impl<'s> FromPyObject<'s> for PyBool[src]

impl<'s> FromPyObject<'s> for &'s PyBool[src]

impl PythonObject for PyBool[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 PyBool[src]

impl PythonObjectWithTypeObject for PyBool[src]

impl ToPyObject for PyBool[src]

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

type ObjectType = PyBool

Auto Trait Implementations

impl RefUnwindSafe for PyBool[src]

impl Send for PyBool[src]

impl Sync for PyBool[src]

impl Unpin for PyBool[src]

impl UnwindSafe for PyBool[src]

Blanket Implementations

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

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

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

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.