SimpleWindowCtx

Struct SimpleWindowCtx 

Source
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: WindowSpec

Implementations§

Source§

impl<'a, 'b> SimpleWindowCtx<'a, 'b>

Source

pub fn new( args: &'a [ArgumentHandle<'a, 'b>], fctx: &'a dyn FunctionContext, spec: WindowSpec, ) -> Self

Source

pub fn spec(&self) -> WindowSpec

Source

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.

Source

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.

Source

pub fn reduce_windows<T, FI, FF, FC>( &mut self, init: FI, fold: FF, combine: FC, ) -> Result<T, ExcelError>
where T: Send, FI: Fn() -> T + Sync, FF: Fn(&[Vec<LiteralValue>], &mut T) -> Result<(), ExcelError> + Sync, FC: Fn(T, T) -> T + Sync,

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V