[]Enum rustpython_vm::pyobject::PyArithmaticValue

pub enum PyArithmaticValue<T> {
    NotImplemented,
    Implemented(T),
}

Variants

NotImplemented
Implemented(T)

Methods

impl<T> PyArithmaticValue<T>

pub fn is_not_implemented(&self) -> bool

Returns true if self is of variant NotImplemented.

pub fn is_implemented(&self) -> bool

Returns true if self is of variant Implemented.

pub fn expect_implemented(self) -> T where
    Self: Debug

Unwraps the value, yielding the content of Implemented.

Panics

Panics if the value is not Implemented, with a panic message including the content of self.

pub fn implemented(self) -> Option<T>

Returns Some if self is of variant Implemented, and None otherwise.

impl<T> PyArithmaticValue<T>

pub fn from_option(option: Option<T>) -> Self

pub fn into_option(self) -> Option<T>

pub fn as_option(&self) -> Option<&T>

pub fn as_option_mut(&mut self) -> Option<&mut T>

pub fn as_ref(&self) -> PyArithmaticValue<&T>

pub fn as_mut(&mut self) -> PyArithmaticValue<&mut T>

pub fn expect(self, msg: &str) -> T

pub fn unwrap(self) -> T

pub fn unwrap_or(self, default: T) -> T

pub fn unwrap_or_else<F: FnOnce() -> T>(self, f: F) -> T

pub fn map<U, F: FnOnce(T) -> U>(self, f: F) -> PyArithmaticValue<U>

pub fn map_or<U, F: FnOnce(T) -> U>(self, default: U, f: F) -> U

pub fn map_or_else<U, D: FnOnce() -> U, F: FnOnce(T) -> U>(
    self,
    default: D,
    f: F
) -> U

pub fn ok_or<E>(self, err: E) -> Result<T, E>

pub fn ok_or_else<E, F: FnOnce() -> E>(self, err: F) -> Result<T, E>

pub fn and<U>(self, optb: PyArithmaticValue<U>) -> PyArithmaticValue<U>

pub fn and_then<U, F: FnOnce(T) -> PyArithmaticValue<U>>(
    self,
    f: F
) -> PyArithmaticValue<U>

pub fn filter<P: FnOnce(&T) -> bool>(self, predicate: P) -> Self

pub fn or(self, optb: PyArithmaticValue<T>) -> PyArithmaticValue<T>

pub fn or_else<F: FnOnce() -> PyArithmaticValue<T>>(
    self,
    f: F
) -> PyArithmaticValue<T>

pub fn xor(self, optb: PyArithmaticValue<T>) -> PyArithmaticValue<T>

pub fn get_or_insert(&mut self, v: T) -> &mut T

pub fn get_or_insert_with<F: FnOnce() -> T>(&mut self, f: F) -> &mut T

pub fn take(&mut self) -> Self

pub fn replace(&mut self, value: T) -> Self

impl<'_, T: Copy> PyArithmaticValue<&'_ T>

pub fn copied(self) -> PyArithmaticValue<T>

impl<'_, T: Copy> PyArithmaticValue<&'_ mut T>

pub fn copied(self) -> PyArithmaticValue<T>

impl<'_, T: Clone> PyArithmaticValue<&'_ T>

pub fn cloned(self) -> PyArithmaticValue<T>

impl<'_, T: Clone> PyArithmaticValue<&'_ mut T>

pub fn cloned(self) -> PyArithmaticValue<T>

impl<T: Default> PyArithmaticValue<T>

pub fn unwrap_or_default(self) -> T

impl<T: Deref> PyArithmaticValue<T>

pub fn as_deref(&self) -> PyArithmaticValue<&T::Target>

impl<T: DerefMut> PyArithmaticValue<T>

pub fn as_deref_mut(&mut self) -> PyArithmaticValue<&mut T::Target>

impl<T, E> PyArithmaticValue<Result<T, E>>

pub fn transpose(self) -> Result<Option<T>, E>

Trait Implementations

impl<T: Clone> Clone for PyArithmaticValue<T>

impl<T: Copy> Copy for PyArithmaticValue<T>

impl<T: Debug> Debug for PyArithmaticValue<T>

impl<T> Default for PyArithmaticValue<T>

impl<T: Eq> Eq for PyArithmaticValue<T>

impl<'a, T> From<&'a PyArithmaticValue<T>> for PyArithmaticValue<&'a T>

impl<'a, T> From<&'a mut PyArithmaticValue<T>> for PyArithmaticValue<&'a mut T>

impl<T> From<T> for PyArithmaticValue<T>

impl<T: Hash> Hash for PyArithmaticValue<T>

impl<T> IntoIterator for PyArithmaticValue<T>

type Item = T

The type of the elements being iterated over.

type IntoIter = IntoIter<T>

Which kind of iterator are we turning this into?

impl<T> IntoPyObject for PyArithmaticValue<T> where
    T: IntoPyObject
[src]

impl<T> OptionLike<T> for PyArithmaticValue<T>

impl<T: Ord> Ord for PyArithmaticValue<T>

impl<T: PartialEq> PartialEq<PyArithmaticValue<T>> for PyArithmaticValue<T>

impl<T: PartialOrd> PartialOrd<PyArithmaticValue<T>> for PyArithmaticValue<T>

impl<T> StructuralEq for PyArithmaticValue<T>

impl<T> StructuralPartialEq for PyArithmaticValue<T>

Auto Trait Implementations

impl<T> RefUnwindSafe for PyArithmaticValue<T> where
    T: RefUnwindSafe

impl<T> Send for PyArithmaticValue<T> where
    T: Send

impl<T> Sync for PyArithmaticValue<T> where
    T: Sync

impl<T> Unpin for PyArithmaticValue<T> where
    T: Unpin

impl<T> UnwindSafe for PyArithmaticValue<T> where
    T: UnwindSafe

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<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

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

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

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

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T> IntoPyObject for T where
    T: PyValue
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Statistics<f64> for T where
    T: IntoIterator,
    <T as IntoIterator>::Item: Borrow<f64>, 

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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<V, T> VZip<V> for T where
    V: MultiLane<T>,