Movatterモバイル変換


[0]ホーム

URL:


[][src]Structrustpython_vm::function::PyFuncArgs

pub struct PyFuncArgs {    pub args:Vec<PyObjectRef>,    pub kwargs:IndexMap<String,PyObjectRef>,}

ThePyFuncArgs struct is one of the most used structs then creatinga rust function that can be called from python. It holds both positionalarguments, as well as keyword arguments passed to the function.

Fields

args:Vec<PyObjectRef>kwargs:IndexMap<String,PyObjectRef>

Methods

implPyFuncArgs[src]

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

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

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

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

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

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

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

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

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

pub fnremaining_keywords<'a>(
    &'a mut self
) -> implIterator<Item =(String,PyObjectRef)> + 'a
[src]

pub fnbind<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 leftoverarguments after performing the binding, or if an argument is not ofthe expected type, a TypeError is raised.

If the givenFromArgs includes any conversions, exceptions raisedduring the conversion will halt the binding and return the error.

Trait Implementations

implClone forPyFuncArgs[src]

fnclone(&self) ->PyFuncArgs[src]

fnclone_from(&mut self, source:&Self)1.0.0[src]

implDebug forPyFuncArgs[src]

fnfmt(&self, f: &mutFormatter) ->Result[src]

implDefault forPyFuncArgs[src]

fndefault() ->PyFuncArgs[src]

impl<'_, '_>From<(&'_Args<Rc<PyObject<dynPyObjectPayload + 'static>>>, &'_KwArgs<Rc<PyObject<dynPyObjectPayload + 'static>>>)> forPyFuncArgs[src]

fnfrom(arg:(&Args, &KwArgs)) -> Self[src]

implFrom<Rc<PyObject<dynPyObjectPayload + 'static>>> forPyFuncArgs[src]

fnfrom(arg:PyObjectRef) -> Self[src]

implFrom<Vec<Rc<PyObject<dynPyObjectPayload + 'static>>>> forPyFuncArgs[src]

Conversion from vector of python objects to function arguments.

fnfrom(args:Vec<PyObjectRef>) -> Self[src]

implFromArgs forPyFuncArgs[src]

fnfrom_args(
    _vm: &VirtualMachine,
    args: &mutPyFuncArgs
) ->Result<Self,ArgumentError>
[src]

fnarity() ->RangeInclusive<usize>[src]

impl<F>IntoPyNativeFunc<PyFuncArgs,Result<Rc<PyObject<dynPyObjectPayload + 'static>>,PyRef<PyBaseException>>,VirtualMachine> for Fwhere
    F:Fn(&VirtualMachine,PyFuncArgs) ->PyResult + 'static, 
[src]

Auto Trait Implementations

impl !RefUnwindSafe forPyFuncArgs

impl !Send forPyFuncArgs

impl !Sync forPyFuncArgs

implUnpin forPyFuncArgs

impl !UnwindSafe forPyFuncArgs

Blanket Implementations

impl<T>Any for Twhere
    T: 'static + ?Sized
[src]

fntype_id(&self) ->TypeId[src]

impl<T>Borrow<T> for Twhere
    T: ?Sized
[src]

fnborrow(&self) ->&T[src]

impl<T>BorrowMut<T> for Twhere
    T: ?Sized
[src]

fnborrow_mut(&mut self) ->&mutT[src]

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

fnfrom(t: T) -> T[src]

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

fnarity() ->RangeInclusive<usize>[src]

fnfrom_args(&VirtualMachine, &mutPyFuncArgs) ->Result<T,ArgumentError>[src]

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

fninto(self) -> U[src]

impl<T> Same<T> for T

typeOutput = T

Should always beSelf

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

typeOwned = T

The resulting type after obtaining ownership.

fnto_owned(&self) -> T[src]

fnclone_into(&self, target:&mutT)[src]

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

typeError =Infallible

The type returned in the event of a conversion error.

fntry_from(value: U) ->Result<T, <T asTryFrom<U>>::Error>[src]

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

typeError = <U asTryFrom<T>>::Error

The type returned in the event of a conversion error.

fntry_into(self) ->Result<U, <U asTryFrom<T>>::Error>[src]

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

fnvzip(self) -> V


[8]ページ先頭

©2009-2025 Movatter.jp