Skip to main content

Args

Struct Args 

Source
pub(super) struct Args<'a> {
    callee: String,
    declared: Option<&'static [Param]>,
    positional: Vec<&'a Expr>,
    positional_taken: usize,
    named: Vec<(&'a str, &'a Expr, Span, bool)>,
}

Fields§

§callee: String§declared: Option<&'static [Param]>

A built-in’s parameters from its table, which every name the checker asks for must be in, so tools reading the table see the same arguments.

§positional: Vec<&'a Expr>§positional_taken: usize§named: Vec<(&'a str, &'a Expr, Span, bool)>

Implementations§

Source§

impl<'a> Args<'a>

Source

pub(super) fn new( checker: &mut Checker, callee: String, args: &'a [Arg], ) -> Self

callee names what is called in error messages, such as “label”.

Source

pub(super) fn built_in( checker: &mut Checker, name: &str, params: &'static [Param], args: &'a [Arg], ) -> Self

Arguments to the built-in name, whose table entry declares params.

Source

pub(super) fn positional(&mut self) -> Option<&'a Expr>

The next positional argument, if one was given.

Source

pub(super) fn named(&mut self, name: &str) -> Option<&'a Expr>

Source

pub(super) fn param(&mut self, name: &str) -> Option<&'a Expr>

The parameter’s argument, given by position or by name.

Source

pub(super) fn finish(self, checker: &mut Checker)

Reports arguments nothing asked for.

Auto Trait Implementations§

§

impl<'a> Freeze for Args<'a>

§

impl<'a> RefUnwindSafe for Args<'a>

§

impl<'a> Send for Args<'a>

§

impl<'a> Sync for Args<'a>

§

impl<'a> Unpin for Args<'a>

§

impl<'a> UnsafeUnpin for Args<'a>

§

impl<'a> UnwindSafe for Args<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.