pub struct SimpleWindowCtx<'a, 'b> {
pub args: &'a [ArgumentHandle<'a, 'b>],
pub fctx: &'a dyn FunctionContext,
pub spec: WindowSpec,
}Expand description
Window evaluation context passed to windowed functions.
This is intentionally minimal; functions may downcast via as_any() to
access a concrete implementation with more helpers.
Simple window context that wraps raw argument handles and the function context.
Fields§
§args: &'a [ArgumentHandle<'a, 'b>]§fctx: &'a dyn FunctionContext§spec: WindowSpecImplementations§
Source§impl<'a, 'b> SimpleWindowCtx<'a, 'b>
impl<'a, 'b> SimpleWindowCtx<'a, 'b>
pub fn new( args: &'a [ArgumentHandle<'a, 'b>], fctx: &'a dyn FunctionContext, spec: WindowSpec, ) -> Self
pub fn spec(&self) -> WindowSpec
Sourcepub fn for_each_window(
&mut self,
f: impl FnMut(&[LiteralValue]) -> Result<(), ExcelError>,
) -> Result<(), ExcelError>
pub fn for_each_window( &mut self, f: impl FnMut(&[LiteralValue]) -> Result<(), ExcelError>, ) -> Result<(), ExcelError>
Iterate over aligned windows across all arguments in row-major order. For now, only supports width == 1 (single-cell windows) with axis Rows/Cols and step >= 1. The callback receives a slice of window cells (one per argument) at each position.
Sourcepub fn for_each_window_multi(
&mut self,
f: impl FnMut(&[Vec<LiteralValue>]) -> Result<(), ExcelError>,
) -> Result<(), ExcelError>
pub fn for_each_window_multi( &mut self, f: impl FnMut(&[Vec<LiteralValue>]) -> Result<(), ExcelError>, ) -> Result<(), ExcelError>
Multi-width window iteration. Produces, for each window position, a Vec per argument
containing the window’s cells in window order (k=0..width-1) along the selected axis.
Padding behavior is controlled by spec.padding.
Sourcepub fn reduce_windows<T, FI, FF, FC>(
&mut self,
init: FI,
fold: FF,
combine: FC,
) -> Result<T, ExcelError>
pub fn reduce_windows<T, FI, FF, FC>( &mut self, init: FI, fold: FF, combine: FC, ) -> Result<T, ExcelError>
Reduce over windows with optional parallel chunking. The reducer functions must be pure over their inputs and combine must be associative to ensure deterministic results.
Auto Trait Implementations§
impl<'a, 'b> Freeze for SimpleWindowCtx<'a, 'b>
impl<'a, 'b> !RefUnwindSafe for SimpleWindowCtx<'a, 'b>
impl<'a, 'b> !Send for SimpleWindowCtx<'a, 'b>
impl<'a, 'b> !Sync for SimpleWindowCtx<'a, 'b>
impl<'a, 'b> Unpin for SimpleWindowCtx<'a, 'b>
impl<'a, 'b> !UnwindSafe for SimpleWindowCtx<'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