pub struct ArgumentHandle<'a, 'b> { /* private fields */ }Implementations§
Source§impl<'a, 'b> ArgumentHandle<'a, 'b>
impl<'a, 'b> ArgumentHandle<'a, 'b>
Sourcepub fn is_omitted(&self) -> bool
pub fn is_omitted(&self) -> bool
Returns whether this handle represents an explicitly omitted argument slot.
This is false for absent arguments, explicit empty text, and blank references.
pub fn value(&self) -> Result<CalcValue<'b>, ExcelError>
pub fn value_with_env(&self, env: LocalEnv) -> Result<CalcValue<'b>, ExcelError>
pub fn current_env(&self) -> LocalEnv
pub fn inline_array_literal( &self, ) -> Result<Option<Vec<Vec<LiteralValue>>>, ExcelError>
pub fn range(&self) -> Result<Box<dyn Range>, ExcelError>
Sourcepub fn range_view(&self) -> Result<RangeView<'b>, ExcelError>
pub fn range_view(&self) -> Result<RangeView<'b>, ExcelError>
Resolve this argument to a RangeView.
Delegates to Self::resolve_once so reference-shaped and computed
arguments share one cached resolution path. A reference keeps its lazy
view, while a computed argument (B1:B3="x", SEQUENCE(3), {1,2})
resolves through the same single evaluation the rest of argument
preparation uses instead of being rejected for not being a reference.
Sourcepub fn range_view_or_scalar(&self) -> Result<RangeView<'b>, ExcelError>
pub fn range_view_or_scalar(&self) -> Result<RangeView<'b>, ExcelError>
Resolve this argument to a RangeView, promoting a scalar to a 1x1 view.
Excel treats a scalar handed to a range-consuming function as a 1x1 array,
so =TRANSPOSE(2) is 2 rather than an error. Self::range_view rejects
scalars, and a function that wants the Excel behaviour opts in here.
This is deliberately not the behaviour of range_view itself. Several
builtins use a range_view failure as type dispatch, where “scalar” and
“1x1 range” mean genuinely different things – MEDIAN(TRUE) is 1
because a direct scalar is coerced while a range cell of the same type is
skipped, and a D-function’s scalar criteria argument is an error rather
than an empty criteria block that matches every row. Promoting inside
range_view would silently change those answers. The rule for choosing
between the two: a function that distinguishes a scalar argument from a
1x1 range keeps range_view.
An error scalar propagates as an error rather than becoming a 1x1 view
containing it, so =TRANSPOSE(NA()) is #N/A instead of being masked as
#REF!.
pub fn value_or_range(&self) -> Result<EvaluatedArg<'_>, ExcelError>
Sourcepub fn lazy_values_owned(
&'a self,
) -> Result<Box<dyn Iterator<Item = LiteralValue> + 'a>, ExcelError>
pub fn lazy_values_owned( &'a self, ) -> Result<Box<dyn Iterator<Item = LiteralValue> + 'a>, ExcelError>
Lazily iterate values for this argument in row-major expansion order.
- Reference: stream via RangeView (row-major)
- Array literal: evaluate each element lazily per cell
- Scalar/other expressions: a single value
pub fn ast(&self) -> &ASTNode
Sourcepub fn as_reference(&self) -> Result<&ReferenceType, ExcelError>
pub fn as_reference(&self) -> Result<&ReferenceType, ExcelError>
Returns the raw reference from the AST when this argument is a reference. This does not evaluate the reference or materialize values.
Sourcepub fn as_reference_or_eval(&self) -> Result<ReferenceType, ExcelError>
pub fn as_reference_or_eval(&self) -> Result<ReferenceType, ExcelError>
Returns a ReferenceType if this argument is a reference or a function that
can yield a reference via eval_reference. Materializes no values.
pub fn matches_kind(&self, k: ArgKind) -> Result<bool, ExcelError>
Auto Trait Implementations§
impl<'a, 'b> !Freeze for ArgumentHandle<'a, 'b>
impl<'a, 'b> !RefUnwindSafe for ArgumentHandle<'a, 'b>
impl<'a, 'b> !Sync for ArgumentHandle<'a, 'b>
impl<'a, 'b> !UnwindSafe for ArgumentHandle<'a, 'b>
impl<'a, 'b> Send for ArgumentHandle<'a, 'b>
impl<'a, 'b> Unpin for ArgumentHandle<'a, 'b>
impl<'a, 'b> UnsafeUnpin for ArgumentHandle<'a, 'b>
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
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> ⓘ
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> ⓘ
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