Struct starlark::eval::ParametersSpec [−][src]
#[repr(C)]pub struct ParametersSpec<V> { /* fields omitted */ }Expand description
Define a list of parameters. This code assumes that all names are distinct and that
*args/**kwargs occur in well-formed locations.
Implementations
Create a new ParametersSpec with the given function name.
Create a new ParametersSpec with the given function name and an advance capacity hint.
Add a required parameter. Will be an error if the caller doesn’t supply
it. If you want to supply a position-only argument, prepend a $ to
the name.
Add an optional parameter. Will be None if the caller doesn’t supply it.
If you want to supply a position-only argument, prepend a $ to the
name.
Add an optional parameter. Will be the default value if the caller
doesn’t supply it. If you want to supply a position-only argument,
prepend a $ to the name.
Move parameters from Arguments to a list of Value,
using the supplied ParametersSpec.
pub fn collect_into<const N: usize>(
&self,
args: Arguments<'v, '_>,
heap: &'v Heap
) -> Result<[Cell<Option<Value<'v>>>; N]>
Generate documentation for each of the parameters.
Arguments
parameter_typesshould be a mapping of parameter index to typeparameter_docsshould be a mapping of parameter name to possible documentation for that parameter
Create a ParametersParser for given arguments.
Used to freeze a ParametersSpec.
Trait Implementations
Auto Trait Implementations
impl<V> RefUnwindSafe for ParametersSpec<V> where
V: RefUnwindSafe,
impl<V> Send for ParametersSpec<V> where
V: Send,
impl<V> Sync for ParametersSpec<V> where
V: Sync,
impl<V> Unpin for ParametersSpec<V> where
V: Unpin,
impl<V> UnwindSafe for ParametersSpec<V> where
V: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more