Skip to main content

WindowFunc

Struct WindowFunc 

Source
pub struct WindowFunc<K> { /* private fields */ }
Expand description

A bare, argument-free window function reference (row_number(), rank(), dense_rank()) — not yet a usable expression, since a window function has no meaning without an OVER (..) clause. See this module’s doc comment for why this is a separate type from Expr rather than Expr itself.

K is the row key .over(..) stamps onto the result, so a selected row_number() is readable as row.row_number() with nothing declared.

Implementations§

Source§

impl<K> WindowFunc<K>

Source

pub fn over<WindowReq>( self, window: Window<WindowReq>, ) -> Keyed<K, WindowReq, BigInt>

Every ranking function counts rows, so the result is BigInt rather than a parameter — an aggregate over a window, which would have the aggregate’s own type, is the separate shape this module defers.

Trait Implementations§

Source§

impl<K: Spelled> LookupKey for WindowFunc<K>

So row.get(row_number()) works: the key is the function, and a window spec would only be noise at the lookup.

Source§

impl<K> RowKey for WindowFunc<K>

Source§

type Key = K

Auto Trait Implementations§

§

impl<K> Freeze for WindowFunc<K>
where PhantomData<fn() -> K>: Freeze,

§

impl<K> RefUnwindSafe for WindowFunc<K>
where PhantomData<fn() -> K>: RefUnwindSafe,

§

impl<K> Send for WindowFunc<K>
where PhantomData<fn() -> K>: Send,

§

impl<K> Sync for WindowFunc<K>
where PhantomData<fn() -> K>: Sync,

§

impl<K> Unpin for WindowFunc<K>
where PhantomData<fn() -> K>: Unpin,

§

impl<K> UnsafeUnpin for WindowFunc<K>
where PhantomData<fn() -> K>: UnsafeUnpin,

§

impl<K> UnwindSafe for WindowFunc<K>
where PhantomData<fn() -> K>: UnwindSafe,

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<S> Superset<Nil, Nil> for S

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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<T> WrapNullable<NotNull> for T