Struct erg_compiler::hir::Args
source · pub struct Args {
pub pos_args: Vec<PosArg>,
pub var_args: Option<Box<PosArg>>,
pub kw_args: Vec<KwArg>,
pub kw_var: Option<Box<PosArg>>,
pub paren: Option<(Token, Token)>,
}
Fields§
§pos_args: Vec<PosArg>
§var_args: Option<Box<PosArg>>
§kw_args: Vec<KwArg>
§kw_var: Option<Box<PosArg>>
§paren: Option<(Token, Token)>
Implementations§
source§impl Args
impl Args
pub fn new( pos_args: Vec<PosArg>, var_args: Option<PosArg>, kw_args: Vec<KwArg>, kw_var: Option<PosArg>, paren: Option<(Token, Token)> ) -> Self
pub fn values(exprs: Vec<Expr>, paren: Option<(Token, Token)>) -> Self
pub fn single(pos_arg: PosArg) -> Self
pub fn pos_only(pos_args: Vec<PosArg>, paren: Option<(Token, Token)>) -> Self
pub fn empty() -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn kw_len(&self) -> usize
pub fn push_pos(&mut self, pos: PosArg)
pub fn push_kw(&mut self, kw: KwArg)
pub fn remove(&mut self, index: usize) -> Expr
sourcepub fn try_remove(&mut self, index: usize) -> Option<Expr>
pub fn try_remove(&mut self, index: usize) -> Option<Expr>
try_remove((1, 2, z: 3), 2) == Some(3)
pub fn try_remove_pos(&mut self, index: usize) -> Option<PosArg>
pub fn try_remove_kw(&mut self, index: usize) -> Option<KwArg>
pub fn get(&self, index: usize) -> Option<&Expr>
pub fn last(&self) -> Option<&Expr>
pub fn remove_left_or_key(&mut self, key: &str) -> Option<Expr>
pub fn get_left_or_key(&self, key: &str) -> Option<&Expr>
pub fn get_mut_left_or_key(&mut self, key: &str) -> Option<&mut Expr>
pub fn insert_pos(&mut self, idx: usize, pos: PosArg)
pub fn get_kw(&self, keyword: &str) -> Option<&Expr>
pub fn iter(&self) -> impl Iterator<Item = &Expr>
Trait Implementations§
source§impl Locational for Args
impl Locational for Args
source§impl NestedDisplay for Args
impl NestedDisplay for Args
source§impl NoTypeDisplay for Args
impl NoTypeDisplay for Args
fn to_string_notype(&self) -> String
source§impl PartialEq for Args
impl PartialEq for Args
impl Eq for Args
impl StructuralPartialEq for Args
Auto Trait Implementations§
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