pub struct Arguments {
pub posonlyargs: Vec<Parameter>,
pub args: Vec<Parameter>,
pub vararg: Option<Parameter>,
pub kwonlyargs: Vec<Parameter>,
pub kw_defaults: Vec<Option<Box<ExprType>>>,
pub kwarg: Option<Parameter>,
pub defaults: Vec<Box<ExprType>>,
}
Expand description
Comprehensive function arguments structure supporting all Python argument types.
Fields§
§posonlyargs: Vec<Parameter>
Positional-only parameters (before / in Python 3.8+)
args: Vec<Parameter>
Regular positional parameters
vararg: Option<Parameter>
Variable positional parameter (*args)
kwonlyargs: Vec<Parameter>
Keyword-only parameters (after * or *args)
kw_defaults: Vec<Option<Box<ExprType>>>
Default values for keyword-only parameters (None = required)
kwarg: Option<Parameter>
Variable keyword parameter (**kwargs)
defaults: Vec<Box<ExprType>>
Default values for regular positional parameters
Trait Implementations§
Source§impl CodeGen for Arguments
impl CodeGen for Arguments
Source§type Context = CodeGenContext
type Context = CodeGenContext
A type, generally an enum, that passes the code generator the context of the node.
Source§type Options = PythonOptions
type Options = PythonOptions
A struct representing the set of compilation options.
Source§type SymbolTable = SymbolTableScopes
type SymbolTable = SymbolTableScopes
A trait for a symbol table
Source§fn to_rust(
self,
ctx: Self::Context,
options: Self::Options,
symbols: Self::SymbolTable,
) -> Result<TokenStream, Box<dyn Error>>
fn to_rust( self, ctx: Self::Context, options: Self::Options, symbols: Self::SymbolTable, ) -> Result<TokenStream, Box<dyn Error>>
A trait method to output Rust code in a general sense. The output should be stream of Rust tokens,
however, it is not guaranteed that it will fully compile because of scoping errors and other checks
that don’t occur until later.
Source§fn find_symbols(self, symbols_in: Self::SymbolTable) -> Self::SymbolTable
fn find_symbols(self, symbols_in: Self::SymbolTable) -> Self::SymbolTable
A default implementation for find_symbols(), which simply returns the input.
Language nodes that modify the symbol table should override this method.
Source§fn get_docstring(&self) -> Option<String>
fn get_docstring(&self) -> Option<String>
A trait method for extracting a docstring from an object that can have a docstring.
Source§impl<'de> Deserialize<'de> for Arguments
impl<'de> Deserialize<'de> for Arguments
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'a> FromPyObject<'a> for Arguments
impl<'a> FromPyObject<'a> for Arguments
impl StructuralPartialEq for Arguments
Auto Trait Implementations§
impl Freeze for Arguments
impl RefUnwindSafe for Arguments
impl Send for Arguments
impl Sync for Arguments
impl Unpin for Arguments
impl UnwindSafe for Arguments
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ErrorContext for Twhere
T: Debug,
impl<T> ErrorContext for Twhere
T: Debug,
Source§fn with_context(&self, operation: &str) -> String
fn with_context(&self, operation: &str) -> String
Generate a standardized error message with context.