Struct librsnek::system::primitives::Signature
[−]
[src]
pub struct Signature { args: Box<[String]>, required_kwargs: Box<[String]>, vargs: Option<String>, default_kwargs: HashMap<String, RtObject>, kwargs: Option<String>, }
Represents the canonical python function signature of
Fields
args: Box<[String]>
Good ol' "business in the front" positional named arguments
required_kwargs: Box<[String]>
def(*, named,...)
required keyword only arguments
vargs: Option<String>
vargs = "*name"
default_kwargs: HashMap<String, RtObject>
name="value"
kwargs: Option<String>
and the "party in the back" **kwargs
arguments.
Methods
impl Signature
[src]
fn new(
args: &[&str],
required_kwargs: &[&str],
vargs: Option<&str>,
kwargs: Option<&str>
) -> Self
args: &[&str],
required_kwargs: &[&str],
vargs: Option<&str>,
kwargs: Option<&str>
) -> Self
By default, creating a sigunature
fn args(&self) -> &[String]
fn has_vargs(&self) -> Boolean
fn has_kwargs(&self) -> Boolean
fn vargs(&self) -> Option<&str>
Return the variable Some(name)
for *kwargs
if present, otherwise None
fn kwargs(&self) -> Option<&str>
Return the variable Some(name)
for **kwargs
if present, otherwise None
fn min_arg_count(&self) -> Integer
Return the minimum number of arguments allowed by this Signature
.
fn max_arg_count(&self) -> Option<Integer>
Return the maximum number of arguments allowed by the Signature
as
Trait Implementations
impl Clone for Signature
[src]
fn clone(&self) -> Signature
Returns a copy of the value.
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
.
impl Debug for Signature
[src]
impl Eq for Signature
[src]
fn assert_receiver_is_total_eq(&self)
impl PartialEq for Signature
[src]
fn eq(&self, __arg_0: &Signature) -> bool
This method tests for self
and other
values to be equal, and is used
fn ne(&self, __arg_0: &Signature) -> bool
This method tests for !=
.