Struct erg_parser::ast::Params
source · pub struct Params {
pub non_defaults: Vec<NonDefaultParamSignature>,
pub var_params: Option<Box<NonDefaultParamSignature>>,
pub defaults: Vec<DefaultParamSignature>,
pub kw_var_params: Option<Box<NonDefaultParamSignature>>,
pub guards: Vec<GuardClause>,
pub parens: Option<(Token, Token)>,
}
Fields§
§non_defaults: Vec<NonDefaultParamSignature>
§var_params: Option<Box<NonDefaultParamSignature>>
§defaults: Vec<DefaultParamSignature>
§kw_var_params: Option<Box<NonDefaultParamSignature>>
§guards: Vec<GuardClause>
match conditions
parens: Option<(Token, Token)>
Implementations§
source§impl Params
impl Params
pub fn new( non_defaults: Vec<NonDefaultParamSignature>, var_params: Option<NonDefaultParamSignature>, defaults: Vec<DefaultParamSignature>, kw_var_params: Option<NonDefaultParamSignature>, parens: Option<(Token, Token)> ) -> Self
pub fn empty() -> Self
pub fn single(non_default: NonDefaultParamSignature) -> Self
pub fn non_defaults(&self) -> Vec<NonDefaultParamSignature>
pub fn var_params(&self) -> Option<NonDefaultParamSignature>
pub fn defaults(&self) -> Vec<DefaultParamSignature>
pub fn kw_var_params(&self) -> Option<NonDefaultParamSignature>
pub fn guards(&self) -> Vec<GuardClause>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn add_guard(&mut self, guard: GuardClause)
pub fn extend_guards(&mut self, guards: Vec<GuardClause>)
source§impl Params
impl Params
pub fn deconstruct( self ) -> (Vec<NonDefaultParamSignature>, Option<Box<NonDefaultParamSignature>>, Vec<DefaultParamSignature>, Option<Box<NonDefaultParamSignature>>, Vec<GuardClause>, Option<(Token, Token)>)
pub fn sigs(&self) -> impl Iterator<Item = &NonDefaultParamSignature>
Trait Implementations§
source§impl Locational for Params
impl Locational for Params
source§impl PartialEq for Params
impl PartialEq for Params
impl Eq for Params
impl StructuralPartialEq for Params
Auto Trait Implementations§
impl Freeze for Params
impl RefUnwindSafe for Params
impl Send for Params
impl Sync for Params
impl Unpin for Params
impl UnwindSafe for Params
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