Skip to main content

Module cursor

Module cursor 

Source
Expand description

Cursor-based pagination for event queries.

This module provides GraphQL-style cursor pagination for efficiently querying large sets of events. It uses keyset pagination for stable, efficient results.

§Key Types

  • Value - Base64-encoded cursor string
  • Args - Pagination arguments (first/after, last/before)
  • ReadResult - Paginated result with edges and page info
  • Reader - In-memory pagination executor

§Example

use evento::cursor::{Args, Reader};

// Forward pagination: first 10 events
let args = Args::forward(10, None);

// Continue from cursor
let args = Args::forward(10, Some(page_info.end_cursor));

// Backward pagination: last 10 events before cursor
let args = Args::backward(10, Some(cursor));

// In-memory pagination
let result = Reader::new(events)
    .forward(10, None)
    .execute()?;

Structs§

Args
Pagination arguments for querying events.
Edge
A paginated item with its cursor.
PageInfo
Pagination metadata for a result set.
ReadResult
Result of a paginated query.
Reader
In-memory pagination executor.
Value
A base64-encoded cursor value for pagination.

Enums§

CursorError
Order
Sort order for pagination.
ReadError

Traits§

Bind
Trait for sorting and filtering data for pagination.
Cursor
Trait for types that can be used as pagination cursors.
Decode
Encode