Table of Contents

Class Cursor

Namespace
Trellis
Assembly
Trellis.Core.dll

Opaque pagination cursor exchanged between server and client. Servers MUST treat the Token contents as their own private encoding; clients MUST treat it as a black box and only echo it back on the next request.

public sealed record Cursor : IEquatable<Cursor>
Inheritance
Cursor
Implements
Inherited Members
Extension Methods

Remarks

Cursors are the canonical "continue from here" primitive for collection pagination in Trellis (see Page<T>). They are intentionally opaque to keep the server free to change its sort order, encoding, signing, or skip strategy without breaking clients.

Absence of a cursor is represented by null at the use site (Cursor? or Page<T>.Next is null). There is no "empty cursor" — a constructed Cursor always carries a non-empty token.

Constructors

Cursor(string)

Creates a cursor with the supplied opaque token.

public Cursor(string token)

Parameters

token string

The opaque continuation token. Must be non-null and non-empty.

Exceptions

ArgumentException

Thrown when token is null or empty.

Properties

Token

The opaque continuation token. Server-defined encoding; never parsed by the client.

public string Token { get; }

Property Value

string

Methods

TryCreate(string?, string?)

Validates a supplied token without throwing for malformed client input.

public static Result<Cursor> TryCreate(string? token, string? fieldName = null)

Parameters

token string
fieldName string

Returns

Result<Cursor>