Struct erg_parser::ast::Args
source · pub struct Args {
pub pos_args: Vec<PosArg>,
pub var_args: Option<Box<PosArg>>,
pub kw_args: Vec<KwArg>,
pub kw_var_args: Option<Box<PosArg>>,
pub paren: Option<(Token, Token)>,
}
Fields§
§pos_args: Vec<PosArg>
§var_args: Option<Box<PosArg>>
§kw_args: Vec<KwArg>
§kw_var_args: Option<Box<PosArg>>
§paren: Option<(Token, Token)>
Implementations§
source§impl Args
impl Args
pub fn deconstruct( self, ) -> (Vec<PosArg>, Option<PosArg>, Vec<KwArg>, Option<PosArg>, Option<(Token, Token)>)
pub fn into_iters( self, ) -> (impl IntoIterator<Item = PosArg>, impl IntoIterator<Item = KwArg>)
pub fn extend_pos<I>(&mut self, iter: I)where
I: IntoIterator<Item = PosArg>,
pub fn pos_args(&self) -> &[PosArg]
source§impl Args
impl Args
pub fn new( pos_args: Vec<PosArg>, var_args: Option<PosArg>, kw_args: Vec<KwArg>, kw_var_args: Option<PosArg>, paren: Option<(Token, Token)>, ) -> Self
pub fn var_args(&self) -> Option<PosArg>
pub fn kw_var_args(&self) -> Option<PosArg>
pub fn pos_only(pos_arg: Vec<PosArg>, paren: Option<(Token, Token)>) -> Self
pub fn single(pos_args: PosArg) -> Self
pub fn empty() -> Self
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
pub fn kw_is_empty(&self) -> bool
pub fn kw_args(&self) -> &[KwArg]
pub fn has_pos_arg(&self, pa: &PosArg) -> bool
pub fn push_pos(&mut self, arg: PosArg)
pub fn remove_pos(&mut self, index: usize) -> PosArg
pub fn insert_pos(&mut self, index: usize, arg: PosArg)
pub fn set_var_args(&mut self, arg: PosArg)
pub fn push_kw(&mut self, arg: KwArg)
pub fn set_kw_var(&mut self, arg: PosArg)
pub fn set_parens(&mut self, paren: (Token, Token))
pub fn get_left_or_key(&self, key: &str) -> Option<&Expr>
pub fn nth_or_key(&self, nth: usize, key: &str) -> Option<&Expr>
pub fn get_nth(&self, nth: usize) -> Option<&Expr>
pub fn get_with_key(&self, key: &str) -> Option<&Expr>
Trait Implementations§
source§impl Locational for Args
impl Locational for Args
source§impl NestedDisplay for Args
impl NestedDisplay for Args
impl Eq for Args
impl StructuralPartialEq for Args
Auto Trait Implementations§
impl Freeze for Args
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)