FnMapCtx

Trait FnMapCtx 

Source
pub trait FnMapCtx {
    // Required methods
    fn is_array_context(&self) -> bool;
    fn map_unary_numeric(
        &mut self,
        f: &mut dyn FnMut(f64) -> Result<LiteralValue, ExcelError>,
    ) -> Result<(), ExcelError>;
    fn map_binary_numeric(
        &mut self,
        f: &mut dyn FnMut(f64, f64) -> Result<LiteralValue, ExcelError>,
    ) -> Result<(), ExcelError>;
    fn finalize(&mut self) -> LiteralValue;
}
Expand description

Context for eval_map (Element-wise operations).

Required Methods§

Source

fn is_array_context(&self) -> bool

Whether inputs indicate an array/range context. If false, callers should fall back to scalar.

Source

fn map_unary_numeric( &mut self, f: &mut dyn FnMut(f64) -> Result<LiteralValue, ExcelError>, ) -> Result<(), ExcelError>

Apply a unary numeric mapping over the broadcasted input. The closure should return the mapped cell.

Source

fn map_binary_numeric( &mut self, f: &mut dyn FnMut(f64, f64) -> Result<LiteralValue, ExcelError>, ) -> Result<(), ExcelError>

Apply a binary numeric mapping over the broadcasted inputs (first two args).

Source

fn finalize(&mut self) -> LiteralValue

Finalize and retrieve the output value (typically an Array). Implementations may move out internal buffers.

Implementors§

Source§

impl<'a, 'b> FnMapCtx for SimpleMapCtx<'a, 'b>