Skip to main content

FnSpec

Struct FnSpec 

Source
pub struct FnSpec {
    pub name: &'static str,
    pub min_args: usize,
    pub max_args: usize,
    pub category: Category,
    pub volatile: bool,
    pub scalar_args: &'static [bool],
    pub value_args: &'static [bool],
    pub signature: &'static str,
    pub description: &'static str,
    pub imp: FnImpl,
}

Fields§

§name: &'static str

Upper-case, without any _xlfn. prefix.

§min_args: usize§max_args: usize

usize::MAX for variadic functions (Excel allows 255 arguments).

§category: Category§volatile: bool§scalar_args: &'static [bool]

For automatic array lifting: true for each parameter position that expects a scalar. When an argument at a scalar position is an array, the function is applied element-wise (broadcast like Excel’s dynamic arrays). The last entry repeats for variadic tails; an empty slice means no lifting.

§value_args: &'static [bool]

Parameter positions that take a single value and reject a reference to more than one cell with #VALUE! (the Analysis ToolPak functions: EOMONTH, WORKDAY, COUPDAYS, BIN2DEC…), where other scalar parameters lift the range. Arrays that aren’t references still lift. Same layout as scalar_args; filled at registration from [lift::value_args].

§signature: &'static str§description: &'static str§imp: FnImpl

Implementations§

Source§

impl FnSpec

Source

pub fn is_scalar_arg(&self, i: usize) -> bool

Whether parameter i expects a scalar (and is therefore lifted over arrays).

Source

pub fn is_value_arg(&self, i: usize) -> bool

Whether parameter i takes a single value, so a multi-cell reference there is #VALUE!.

Source

pub fn accepts(&self, n: usize) -> bool

Whether a call with n arguments is valid (Excel allows at most 255).

Trait Implementations§

Source§

impl Debug for FnSpec

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> Same for T

Source§

type Output = T

Should always be Self
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.