pub struct ArgSpec { /* private fields */ }Implementations§
Source§impl ArgSpec
impl ArgSpec
pub fn new( req: Vec<RcStr>, def: Vec<(RcStr, ConstVal)>, var: Option<RcStr>, key: Option<RcStr>, ) -> ArgSpec
pub fn builder() -> ArgSpecBuilder
pub fn empty() -> ArgSpec
pub fn nparams(&self) -> usize
pub fn params(&self) -> Vec<RcStr>
pub fn apply( &self, flatten_varargs: bool, args: Vec<Value>, kwargs: Option<HashMap<RcStr, Value>>, ) -> Result<(Vec<Value>, Option<HashMap<RcStr, Value>>), Error>
Sourcepub fn apply_and_append_kwmap(
&self,
args: Vec<Value>,
kwargs: Option<HashMap<RcStr, Value>>,
) -> Result<Vec<Value>, Error>
pub fn apply_and_append_kwmap( &self, args: Vec<Value>, kwargs: Option<HashMap<RcStr, Value>>, ) -> Result<Vec<Value>, Error>
Like apply, but the kwargs map is converted to a Value and added to args if a kwargs parameter was specified
pub fn to_value(&self) -> Value
Trait Implementations§
Source§impl From<ArgSpecBuilder> for ArgSpec
impl From<ArgSpecBuilder> for ArgSpec
Source§fn from(builder: ArgSpecBuilder) -> ArgSpec
fn from(builder: ArgSpecBuilder) -> ArgSpec
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ArgSpec
impl RefUnwindSafe for ArgSpec
impl !Send for ArgSpec
impl !Sync for ArgSpec
impl Unpin for ArgSpec
impl UnsafeUnpin for ArgSpec
impl UnwindSafe for ArgSpec
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> SetParameter for T
impl<T> SetParameter for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.