◐ Shell
clean mode source ↗

rustpython_vm::function::PyFuncArgs - Rust

The PyFuncArgs struct is one of the most used structs then creating a rust function that can be called from python. It holds both positional arguments, as well as keyword arguments passed to the function.

impl PyFuncArgs[src]

pub fn new(args: Vec<PyObjectRef>, kwarg_names: Vec<String>) -> PyFuncArgs[src]

pub fn insert(&self, item: PyObjectRef) -> PyFuncArgs[src]

pub fn shift(&mut self) -> PyObjectRef[src]

pub fn get_kwarg(&self, key: &str, default: PyObjectRef) -> PyObjectRef[src]

pub fn get_optional_kwarg(&self, key: &str) -> Option<PyObjectRef>[src]

pub fn get_optional_kwarg_with_type(
    &self,
    key: &str,
    ty: PyClassRef,
    vm: &VirtualMachine
) -> PyResult<Option<PyObjectRef>>
[src]

pub fn take_positional(&mut self) -> Option<PyObjectRef>[src]

pub fn take_positional_keyword(&mut self, name: &str) -> Option<PyObjectRef>[src]

pub fn take_keyword(&mut self, name: &str) -> Option<PyObjectRef>[src]

pub fn remaining_keywords<'a>(
    &'a mut self
) -> impl Iterator<Item = (String, PyObjectRef)> + 'a
[src]

pub fn bind<T: FromArgs>(self, vm: &VirtualMachine) -> PyResult<T>[src]

Binds these arguments to their respective values.

If there is an insufficient number of arguments, there are leftover arguments after performing the binding, or if an argument is not of the expected type, a TypeError is raised.

If the given FromArgs includes any conversions, exceptions raised during the conversion will halt the binding and return the error.

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]

fn from(t: T) -> T[src]

Performs the conversion.

impl<T> FromArgs for T where
    T: TryFromObject
[src]

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

fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

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

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

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

fn vzip(self) -> V