pub struct Args { /* private fields */ }Expand description
Arguments for function calls with fluent API for easy consumption
Implementations§
Source§impl Args
impl Args
pub fn new(positional: Vec<Value>, keywords: IndexMap<String, Value>) -> Self
pub fn positional(positional: Vec<Value>) -> Self
Sourcepub fn set_function_name(&mut self, name: &str)
pub fn set_function_name(&mut self, name: &str)
Set the function name for error messages
Sourcepub fn expect(&mut self, name: &str) -> Result<Value>
pub fn expect(&mut self, name: &str) -> Result<Value>
Get the next positional argument with a descriptive name
Sourcepub fn optional(&mut self, _name: &str, default: Value) -> Value
pub fn optional(&mut self, _name: &str, default: Value) -> Value
Get an optional positional argument with a default value
Sourcepub fn keyword_optional(&mut self, name: &str, default: Value) -> Value
pub fn keyword_optional(&mut self, name: &str, default: Value) -> Value
Get an optional keyword argument with a default value
Source§impl Args
Helper functions for common Args patterns in RustValue implementations
impl Args
Helper functions for common Args patterns in RustValue implementations
Sourcepub fn no_args(&mut self, function_name: &str) -> Result<()>
pub fn no_args(&mut self, function_name: &str) -> Result<()>
Handle no-argument methods - sets function name and validates no args
Sourcepub fn single_f64(&mut self, function_name: &str, arg_name: &str) -> Result<f64>
pub fn single_f64(&mut self, function_name: &str, arg_name: &str) -> Result<f64>
Handle single f64 argument methods
Sourcepub fn single_i64(&mut self, function_name: &str, arg_name: &str) -> Result<i64>
pub fn single_i64(&mut self, function_name: &str, arg_name: &str) -> Result<i64>
Handle single i64 argument methods
Sourcepub fn single_bool(
&mut self,
function_name: &str,
arg_name: &str,
) -> Result<bool>
pub fn single_bool( &mut self, function_name: &str, arg_name: &str, ) -> Result<bool>
Handle single bool argument methods
Sourcepub fn single_string(
&mut self,
function_name: &str,
arg_name: &str,
) -> Result<String>
pub fn single_string( &mut self, function_name: &str, arg_name: &str, ) -> Result<String>
Handle single string argument methods
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Args
impl !RefUnwindSafe for Args
impl !Send for Args
impl !Sync for Args
impl Unpin for Args
impl !UnwindSafe for Args
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