Struct jj_lib::dsl_util::FunctionCallNode
source · 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 str
Function 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§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
)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<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