Skip to main content

Lister

Trait Lister 

Source
pub trait Lister<T>: Execute<T> { }
Expand description

A directory or collection iterator that describes its entries as RDF.

A collection need not be a filesystem directory, and a successful listing can contain no entries. The program defines supported URL schemes, the RDF representation of each entry, and ordering guarantees. One entry can require many RDF statements; pagination counts entries rather than statements or lines.

§Command-line contract

PROGRAM [OPTIONS] INPUT-URL

One absolute collection URL is required as a single argument. There is no stdin payload; stdout contains RDF (jsonl by default). ListerOptions controls output serialization and pagination. Native support for --sort, --offset, --before, --after, and --limit is described by ListerCapabilities; none of these options is required of every program. A host can enforce a limit independently of native support.

Pagination can use either numeric offset plus limit, or URI cursor bounds before/after plus limit. Cursors identify entries by their JSON-LD @id, not by row number or an opaque encoded token. Bounds are exclusive and refer to positions in the selected sort order, not lexical ordering of the URIs. Both bounds may specify an interval; numeric offset is not combined with cursor bounds. Apply sorting, then offset or cursor bounds, then limit. limit selects the first entries of that ordered interval; reverse sort for reverse traversal rather than introducing first/last options. Programs must define stable ordering, tie-breaking, and how missing or deleted cursor IDs are handled. ID-based pagination avoids positional drift when entries are inserted or removed, but does not itself provide snapshot isolation.

The generic result T need not be a Rust iterator. A serialized line is not necessarily a complete logical entry. See crate::programs for links to concrete execution behavior and the lister specification.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§