Enum rustpython_vm::function::PyArithmeticValue
source · pub enum PyArithmeticValue<T> {
Implemented(T),
NotImplemented,
}
Variants§
Implementations§
source§impl<T> PyArithmeticValue<T>
impl<T> PyArithmeticValue<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 expect(self, msg: &str) -> T
pub fn unwrap(self) -> T
pub fn unwrap_or(self, default: T) -> T
pub fn unwrap_or_else<_Function: FnOnce() -> T>(self, f: _Function) -> T
pub fn ok_or<_Error>(self, err: _Error) -> Result<T, _Error>
pub fn ok_or_else<_Error, _Function: FnOnce() -> _Error>( self, err: _Function ) -> Result<T, _Error>
pub fn filter<P: FnOnce(&T) -> bool>(self, predicate: P) -> Self
pub fn or(self, optb: Self) -> Self
pub fn or_else<_Function: FnOnce() -> Self>(self, f: _Function) -> Self
pub fn map_or<_Other, _Function: FnOnce(T) -> _Other>( self, default: _Other, f: _Function ) -> _Other
pub fn xor(self, optb: Self) -> Self
pub fn get_or_insert(&mut self, v: T) -> &mut T
pub fn get_or_insert_with<_Function: FnOnce() -> T>( &mut self, f: _Function ) -> &mut T
pub fn replace(&mut self, value: T) -> Self
source§impl<T> PyArithmeticValue<T>
impl<T> PyArithmeticValue<T>
pub fn as_ref(&self) -> PyArithmeticValue<&T>
pub fn as_mut(&mut self) -> PyArithmeticValue<&mut T>
pub fn map<_Other, _Function: FnOnce(T) -> _Other>( self, f: _Function ) -> PyArithmeticValue<_Other>
pub fn map_or_else<_Other, _Default: FnOnce() -> _Other, _Function: FnOnce(T) -> _Other>( self, default: _Default, f: _Function ) -> _Other
pub fn iter(&self) -> impl Iterator<Item = &T>
pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut T>
pub fn and<_Other>( self, optb: PyArithmeticValue<_Other> ) -> PyArithmeticValue<_Other>
pub fn and_then<_Other, _Function: FnOnce(T) -> PyArithmeticValue<_Other>>( self, f: _Function ) -> PyArithmeticValue<_Other>
pub fn zip<_Other>( self, other: PyArithmeticValue<_Other> ) -> PyArithmeticValue<(T, _Other)>
pub fn take(&mut self) -> Selfwhere T: Default,
pub fn unwrap_or_default(self) -> Twhere T: Default,
source§impl<T> PyArithmeticValue<&T>where
T: Copy,
impl<T> PyArithmeticValue<&T>where T: Copy,
pub fn copied(self) -> PyArithmeticValue<T>
source§impl<T> PyArithmeticValue<&mut T>where
T: Copy,
impl<T> PyArithmeticValue<&mut T>where T: Copy,
pub fn copied(self) -> PyArithmeticValue<T>
source§impl<T> PyArithmeticValue<&T>where
T: Clone,
impl<T> PyArithmeticValue<&T>where T: Clone,
pub fn cloned(self) -> PyArithmeticValue<T>
source§impl<T> PyArithmeticValue<&mut T>where
T: Clone,
impl<T> PyArithmeticValue<&mut T>where T: Clone,
pub fn cloned(self) -> PyArithmeticValue<T>
source§impl<T> PyArithmeticValue<T>where
T: Deref,
impl<T> PyArithmeticValue<T>where T: Deref,
pub fn as_deref(&self) -> PyArithmeticValue<&T::Target>
source§impl<T: DerefMut> PyArithmeticValue<T>
impl<T: DerefMut> PyArithmeticValue<T>
pub fn as_deref_mut(&mut self) -> PyArithmeticValue<&mut T::Target>
source§impl<T, _Error> PyArithmeticValue<Result<T, _Error>>
impl<T, _Error> PyArithmeticValue<Result<T, _Error>>
pub fn transpose(self) -> Result<PyArithmeticValue<T>, _Error>
source§impl PyArithmeticValue<PyObjectRef>
impl PyArithmeticValue<PyObjectRef>
pub fn from_object(vm: &VirtualMachine, obj: PyObjectRef) -> Self
Trait Implementations§
source§impl<T> Clone for PyArithmeticValue<T>where
T: Clone,
impl<T> Clone for PyArithmeticValue<T>where T: Clone,
source§impl<T> Default for PyArithmeticValue<T>
impl<T> Default for PyArithmeticValue<T>
source§impl<T> From<Option<T>> for PyArithmeticValue<T>
impl<T> From<Option<T>> for PyArithmeticValue<T>
source§impl<T> From<PyArithmeticValue<T>> for Option<T>
impl<T> From<PyArithmeticValue<T>> for Option<T>
source§fn from(value: PyArithmeticValue<T>) -> Self
fn from(value: PyArithmeticValue<T>) -> Self
Converts to this type from the input type.
source§impl<T> From<T> for PyArithmeticValue<T>
impl<T> From<T> for PyArithmeticValue<T>
source§impl<T> IntoIterator for PyArithmeticValue<T>
impl<T> IntoIterator for PyArithmeticValue<T>
source§impl<T> OptionLike for PyArithmeticValue<T>
impl<T> OptionLike for PyArithmeticValue<T>
source§impl<T> ToPyObject for PyArithmeticValue<T>where
T: ToPyObject,
impl<T> ToPyObject for PyArithmeticValue<T>where T: ToPyObject,
fn to_pyobject(self, vm: &VirtualMachine) -> PyObjectRef
source§impl<T: TryFromObject> TryFromObject for PyArithmeticValue<T>
impl<T: TryFromObject> TryFromObject for PyArithmeticValue<T>
source§fn try_from_object(vm: &VirtualMachine, obj: PyObjectRef) -> PyResult<Self>
fn try_from_object(vm: &VirtualMachine, obj: PyObjectRef) -> PyResult<Self>
Attempt to convert a Python object to a value of this type.
impl<T> Copy for PyArithmeticValue<T>where T: Copy,
Auto Trait Implementations§
impl<T> RefUnwindSafe for PyArithmeticValue<T>where T: RefUnwindSafe,
impl<T> Send for PyArithmeticValue<T>where T: Send,
impl<T> Sync for PyArithmeticValue<T>where T: Sync,
impl<T> Unpin for PyArithmeticValue<T>where T: Unpin,
impl<T> UnwindSafe for PyArithmeticValue<T>where T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T, U> ExactFrom<T> for Uwhere
U: TryFrom<T>,
impl<T, U> ExactFrom<T> for Uwhere U: TryFrom<T>,
fn exact_from(value: T) -> U
§impl<T, U> ExactInto<U> for Twhere
U: ExactFrom<T>,
impl<T, U> ExactInto<U> for Twhere U: ExactFrom<T>,
fn exact_into(self) -> U
source§impl<T> FromArgOptional for Twhere
T: TryFromObject,
impl<T> FromArgOptional for Twhere T: TryFromObject,
type Inner = T
fn from_inner(x: T) -> T
source§impl<T> FromArgs for Twhere
T: TryFromObject,
impl<T> FromArgs for Twhere T: TryFromObject,
source§fn arity() -> RangeInclusive<usize>
fn arity() -> RangeInclusive<usize>
The range of positional arguments permitted by the function signature. Read more
source§fn from_args(
vm: &VirtualMachine,
args: &mut FuncArgs
) -> Result<T, ArgumentError>
fn from_args( vm: &VirtualMachine, args: &mut FuncArgs ) -> Result<T, ArgumentError>
Extracts this item from the next argument(s).