Struct rustpython_vm::function::ArgIntoComplex
source · #[repr(transparent)]pub struct ArgIntoComplex { /* private fields */ }
Expand description
A Python complex-like object.
ArgIntoComplex
implements FromArgs
so that a built-in function can accept
any object that can be transformed into a complex.
If the object is not a Python complex object but has a __complex__()
method, this method will first be called to convert the object into a float.
If __complex__()
is not defined then it falls back to __float__()
. If
__float__()
is not defined it falls back to __index__()
.
Trait Implementations§
source§impl Debug for ArgIntoComplex
impl Debug for ArgIntoComplex
source§impl Deref for ArgIntoComplex
impl Deref for ArgIntoComplex
source§impl From<ArgIntoComplex> for Complex64
impl From<ArgIntoComplex> for Complex64
source§fn from(arg: ArgIntoComplex) -> Self
fn from(arg: ArgIntoComplex) -> Self
Converts to this type from the input type.
source§impl PartialEq<ArgIntoComplex> for ArgIntoComplex
impl PartialEq<ArgIntoComplex> for ArgIntoComplex
source§fn eq(&self, other: &ArgIntoComplex) -> bool
fn eq(&self, other: &ArgIntoComplex) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl TryFromObject for ArgIntoComplex
impl TryFromObject for ArgIntoComplex
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 StructuralPartialEq for ArgIntoComplex
Auto Trait Implementations§
impl RefUnwindSafe for ArgIntoComplex
impl Send for ArgIntoComplex
impl Sync for ArgIntoComplex
impl Unpin for ArgIntoComplex
impl UnwindSafe for ArgIntoComplex
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).