pub struct FunctionCallNode<'i, T> {
pub name: &'i str,
pub name_span: Span<'i>,
pub args: Vec<ExpressionNode<'i, T>>,
pub keyword_args: Vec<KeywordArgument<'i, T>>,
pub args_span: Span<'i>,
}Expand description
Function call in AST.
Fields§
§name: &'i strFunction name.
name_span: Span<'i>Span of the function name.
args: Vec<ExpressionNode<'i, T>>List of positional arguments.
keyword_args: Vec<KeywordArgument<'i, T>>List of keyword arguments.
args_span: Span<'i>Span of the arguments list.
Implementations§
Source§impl<'i, T> FunctionCallNode<'i, T>
impl<'i, T> FunctionCallNode<'i, T>
Sourcepub fn expect_no_arguments(&self) -> Result<(), InvalidArguments<'i>>
pub fn expect_no_arguments(&self) -> Result<(), InvalidArguments<'i>>
Ensures that no arguments passed.
Sourcepub fn expect_exact_arguments<const N: usize>(
&self,
) -> Result<&[ExpressionNode<'i, T>; N], InvalidArguments<'i>>
pub fn expect_exact_arguments<const N: usize>( &self, ) -> Result<&[ExpressionNode<'i, T>; N], InvalidArguments<'i>>
Extracts exactly N required arguments.
Sourcepub fn expect_some_arguments<const N: usize>(
&self,
) -> Result<(&[ExpressionNode<'i, T>; N], &[ExpressionNode<'i, T>]), InvalidArguments<'i>>
pub fn expect_some_arguments<const N: usize>( &self, ) -> Result<(&[ExpressionNode<'i, T>; N], &[ExpressionNode<'i, T>]), InvalidArguments<'i>>
Extracts N required arguments and remainders.
Sourcepub fn expect_arguments<const N: usize, const M: usize>(
&self,
) -> Result<(&[ExpressionNode<'i, T>; N], [Option<&ExpressionNode<'i, T>>; M]), InvalidArguments<'i>>
pub fn expect_arguments<const N: usize, const M: usize>( &self, ) -> Result<(&[ExpressionNode<'i, T>; N], [Option<&ExpressionNode<'i, T>>; M]), InvalidArguments<'i>>
Extracts N required arguments and M optional arguments.
Sourcepub fn expect_named_arguments<const N: usize, const M: usize>(
&self,
names: &[&str],
) -> Result<([&ExpressionNode<'i, T>; N], [Option<&ExpressionNode<'i, T>>; M]), InvalidArguments<'i>>
pub fn expect_named_arguments<const N: usize, const M: usize>( &self, names: &[&str], ) -> Result<([&ExpressionNode<'i, T>; N], [Option<&ExpressionNode<'i, T>>; M]), InvalidArguments<'i>>
Extracts N required arguments and M optional arguments. Some of them can be specified as keyword arguments.
names is a list of parameter names. Unnamed positional arguments
should be padded with "".
Trait Implementations§
Source§impl<'i, T: Clone> Clone for FunctionCallNode<'i, T>
impl<'i, T: Clone> Clone for FunctionCallNode<'i, T>
Source§fn clone(&self) -> FunctionCallNode<'i, T>
fn clone(&self) -> FunctionCallNode<'i, T>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'i, T: Debug> Debug for FunctionCallNode<'i, T>
impl<'i, T: Debug> Debug for FunctionCallNode<'i, T>
Source§impl<'i, T: PartialEq> PartialEq for FunctionCallNode<'i, T>
impl<'i, T: PartialEq> PartialEq for FunctionCallNode<'i, T>
impl<'i, T: Eq> Eq for FunctionCallNode<'i, T>
impl<'i, T> StructuralPartialEq for FunctionCallNode<'i, T>
Auto Trait Implementations§
impl<'i, T> Freeze for FunctionCallNode<'i, T>
impl<'i, T> RefUnwindSafe for FunctionCallNode<'i, T>where
T: RefUnwindSafe,
impl<'i, T> Send for FunctionCallNode<'i, T>where
T: Send,
impl<'i, T> Sync for FunctionCallNode<'i, T>where
T: Sync,
impl<'i, T> Unpin for FunctionCallNode<'i, T>where
T: Unpin,
impl<'i, T> UnwindSafe for FunctionCallNode<'i, T>where
T: UnwindSafe,
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more