Struct rustpython_vm::function::PosArgs
source · pub struct PosArgs<T = PyObjectRef>(_);
Expand description
A list of positional argument values.
A built-in function with a PosArgs
parameter is analogous to a Python
function with *args
. All remaining positional arguments are extracted
(and hence the function will permit an arbitrary number of them).
PosArgs
optionally accepts a generic type parameter to allow type checks
or conversions of each argument.
Implementations§
source§impl<T: PyPayload> PosArgs<PyRef<T>>
impl<T: PyPayload> PosArgs<PyRef<T>>
pub fn into_tuple(self, vm: &VirtualMachine) -> PyTupleRef
Trait Implementations§
source§impl<T> FromArgs for PosArgs<T>where
T: TryFromObject,
impl<T> FromArgs for PosArgs<T>where T: TryFromObject,
source§fn from_args(
vm: &VirtualMachine,
args: &mut FuncArgs
) -> Result<Self, ArgumentError>
fn from_args( vm: &VirtualMachine, args: &mut FuncArgs ) -> Result<Self, ArgumentError>
Extracts this item from the next argument(s).
source§impl<T> IntoIterator for PosArgs<T>
impl<T> IntoIterator for PosArgs<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for PosArgs<T>where T: RefUnwindSafe,
impl<T> Send for PosArgs<T>where T: Send,
impl<T> Sync for PosArgs<T>where T: Sync,
impl<T> Unpin for PosArgs<T>where T: Unpin,
impl<T> UnwindSafe for PosArgs<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> IntoFuncArgs for Twhere
T: Into<FuncArgs>,
impl<T> IntoFuncArgs for Twhere T: Into<FuncArgs>,
fn into_args(self, _vm: &VirtualMachine) -> FuncArgs
fn into_method_args(self, obj: PyObjectRef, vm: &VirtualMachine) -> FuncArgs
§impl<T, U> OverflowingInto<U> for Twhere
U: OverflowingFrom<T>,
impl<T, U> OverflowingInto<U> for Twhere U: OverflowingFrom<T>,
fn overflowing_into(self) -> (U, bool)
§impl<T, U> RoundingInto<U> for Twhere
U: RoundingFrom<T>,
impl<T, U> RoundingInto<U> for Twhere U: RoundingFrom<T>,
fn rounding_into(self, rm: RoundingMode) -> U
§impl<T, U> SaturatingInto<U> for Twhere
U: SaturatingFrom<T>,
impl<T, U> SaturatingInto<U> for Twhere U: SaturatingFrom<T>,
fn saturating_into(self) -> U
source§impl<T> ToHex for Twhere
T: AsRef<[u8]>,
impl<T> ToHex for Twhere T: AsRef<[u8]>,
source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Lower case
letters are used (e.g. f9b4ca
)source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Upper case
letters are used (e.g. F9B4CA
)