Skip to main content

ListerOptionsBuilder

Struct ListerOptionsBuilder 

Source
pub struct ListerOptionsBuilder<S: State = Empty> { /* private fields */ }
Expand description

Use builder syntax to set the inputs and finish with build().

Implementations§

Source§

impl<S: State> ListerOptionsBuilder<S>

Source

pub fn build(self) -> ListerOptions
where S: IsComplete,

Finish building and return the requested object

Source

pub fn sort(self, value: SortKeys) -> ListerOptionsBuilder<SetSort<S>>
where S::Sort: IsUnset,

Optional (Some / Option setters). Ordering request passed as --sort=SORT using SortKeys’ display syntax.

SortKeys uses a - prefix for descending keys. This is the SDK’s representation, not a universally supported PPS grammar; the program must support both the option and the resulting expression. None omits the request and uses the program’s documented default order.

Source

pub fn maybe_sort( self, value: Option<SortKeys>, ) -> ListerOptionsBuilder<SetSort<S>>
where S::Sort: IsUnset,

Optional (Some / Option setters). Ordering request passed as --sort=SORT using SortKeys’ display syntax.

SortKeys uses a - prefix for descending keys. This is the SDK’s representation, not a universally supported PPS grammar; the program must support both the option and the resulting expression. None omits the request and uses the program’s documented default order.

Source

pub fn offset(self, value: usize) -> ListerOptionsBuilder<SetOffset<S>>
where S::Offset: IsUnset,

Optional (Some / Option setters). Number of entries to skip, passed as --offset=COUNT.

None omits the option (default 0); Some(0) explicitly skips none. Offset is applied after sorting and before the limit. Programs may omit native support. Do not combine an offset, even Some(0), with before or after; these are alternative pagination modes.

Source

pub fn maybe_offset( self, value: Option<usize>, ) -> ListerOptionsBuilder<SetOffset<S>>
where S::Offset: IsUnset,

Optional (Some / Option setters). Number of entries to skip, passed as --offset=COUNT.

None omits the option (default 0); Some(0) explicitly skips none. Offset is applied after sorting and before the limit. Programs may omit native support. Do not combine an offset, even Some(0), with before or after; these are alternative pagination modes.

Source

pub fn before( self, value: impl Into<String>, ) -> ListerOptionsBuilder<SetBefore<S>>
where S::Before: IsUnset,

Optional (Some / Option setters). Exclusive upper cursor bound, passed as --before=URI.

The URI identifies an entry by its JSON-LD @id; it is an absolute URI string, not a JSON object or an opaque encoded cursor. Select entries before that entry in the chosen sort order. May be combined with after to bound an interval, but not with numeric offset. None omits the bound. The options value stores this string without validation or normalization.

Source

pub fn maybe_before( self, value: Option<impl Into<String>>, ) -> ListerOptionsBuilder<SetBefore<S>>
where S::Before: IsUnset,

Optional (Some / Option setters). Exclusive upper cursor bound, passed as --before=URI.

The URI identifies an entry by its JSON-LD @id; it is an absolute URI string, not a JSON object or an opaque encoded cursor. Select entries before that entry in the chosen sort order. May be combined with after to bound an interval, but not with numeric offset. None omits the bound. The options value stores this string without validation or normalization.

Source

pub fn after( self, value: impl Into<String>, ) -> ListerOptionsBuilder<SetAfter<S>>
where S::After: IsUnset,

Optional (Some / Option setters). Exclusive lower cursor bound, passed as --after=URI.

The URI identifies an entry by its JSON-LD @id. Select entries after that entry in the chosen sort order. May be combined with before, but not with numeric offset. None omits the bound. As with before, the options value stores the absolute URI string without validating it.

Source

pub fn maybe_after( self, value: Option<impl Into<String>>, ) -> ListerOptionsBuilder<SetAfter<S>>
where S::After: IsUnset,

Optional (Some / Option setters). Exclusive lower cursor bound, passed as --after=URI.

The URI identifies an entry by its JSON-LD @id. Select entries after that entry in the chosen sort order. May be combined with before, but not with numeric offset. None omits the bound. As with before, the options value stores the absolute URI string without validating it.

Source

pub fn limit(self, value: usize) -> ListerOptionsBuilder<SetLimit<S>>
where S::Limit: IsUnset,

Optional (Some / Option setters). Requested listing limit (--limit=COUNT, or -n, when forwarded natively).

None imposes no caller-requested limit; Some(0) requests no entries. ListerCapabilities::limit describes native support. A host can enforce the request even when the native flag is unsupported, and independently cap output to protect against bugs in programs that do accept the flag. The program contract counts complete entries, not RDF statements, lines, or bytes; consult the runner’s listing behavior for its additional line-based cap and zero-limit handling. This options value does not validate entry boundaries.

Source

pub fn maybe_limit( self, value: Option<usize>, ) -> ListerOptionsBuilder<SetLimit<S>>
where S::Limit: IsUnset,

Optional (Some / Option setters). Requested listing limit (--limit=COUNT, or -n, when forwarded natively).

None imposes no caller-requested limit; Some(0) requests no entries. ListerCapabilities::limit describes native support. A host can enforce the request even when the native flag is unsupported, and independently cap output to protect against bugs in programs that do accept the flag. The program contract counts complete entries, not RDF statements, lines, or bytes; consult the runner’s listing behavior for its additional line-based cap and zero-limit handling. This options value does not validate entry boundaries.

Source

pub fn output( self, value: impl Into<String>, ) -> ListerOptionsBuilder<SetOutput<S>>
where S::Output: IsUnset,

Optional (Some / Option setters). RDF serialization passed as --output=FORMAT (-o in the CLI).

None omits the option; the specified program default is jsonl. The option does not define how an entry maps to RDF or select a file.

Source

pub fn maybe_output( self, value: Option<impl Into<String>>, ) -> ListerOptionsBuilder<SetOutput<S>>
where S::Output: IsUnset,

Optional (Some / Option setters). RDF serialization passed as --output=FORMAT (-o in the CLI).

None omits the option; the specified program default is jsonl. The option does not define how an entry maps to RDF or select a file.

Source§

impl<S: State> ListerOptionsBuilder<S>

Source

pub fn other(self, flag: impl Into<String>) -> Self

Appends one literal argument to ListerOptions::other, preserving order.

Source

pub fn maybe_other(self, flag: Option<impl Into<String>>) -> Self

Appends a present argument to ListerOptions::other; None adds nothing.

Trait Implementations§

Source§

impl<S: State> Debug for ListerOptionsBuilder<S>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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<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.