Skip to main content

Bind

Trait Bind 

Source
pub trait Bind {
    type T: IntoColumnRef + Clone;
    type I: IntoIterator<Item = Self::T>;
    type V: IntoIterator<Item = Expr>;
    type Cursor: Cursor;

    // Required methods
    fn columns() -> Self::I;
    fn values(cursor: <<Self as Bind>::Cursor as Cursor>::T) -> Self::V;
}
Expand description

Trait for binding cursor values in paginated queries.

This trait defines how to serialize cursor data for keyset pagination. It specifies which columns are used for ordering and how to extract their values from a cursor.

§Implementation

The trait is implemented for evento_core::Event to enable pagination over the event table using timestamp, version, and ID columns.

§Associated Types

  • T - Column reference type
  • I - Iterator over column references
  • V - Iterator over value expressions
  • Cursor - The cursor type that provides pagination data

Required Associated Types§

Source

type T: IntoColumnRef + Clone

Column reference type (e.g., Event enum variant).

Source

type I: IntoIterator<Item = Self::T>

Iterator type for columns.

Source

type V: IntoIterator<Item = Expr>

Iterator type for values.

Source

type Cursor: Cursor

The cursor type used for pagination.

Required Methods§

Source

fn columns() -> Self::I

Returns the columns used for cursor-based ordering.

Source

fn values(cursor: <<Self as Bind>::Cursor as Cursor>::T) -> Self::V

Extracts values from a cursor for WHERE clause construction.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§