pub struct ListerCapabilities {
pub sort: OptionSupport,
pub offset: OptionSupport,
pub before: OptionSupport,
pub after: OptionSupport,
pub limit: OptionSupport,
}Expand description
Declared native support for a lister program’s optional operations.
Supply this separately from ListerOptions: requests and native support
are independent. Default and an empty builder leave all capabilities
Unknown. Output-format support is not configured
here. A host may obtain these declarations from
module metadata or other knowledge of the program; this crate performs no
discovery. Concrete forwarding and fallback policies belong to the executor.
use asimov_patterns::{ListerCapabilities, OptionSupport};
let capabilities = ListerCapabilities::builder()
.sort(OptionSupport::Unsupported)
.offset(OptionSupport::Supported)
.limit(OptionSupport::Unsupported)
.after(OptionSupport::Supported)
.build();
assert_eq!(capabilities.sort, OptionSupport::Unsupported);
assert_eq!(capabilities.offset, OptionSupport::Supported);
assert_eq!(capabilities.limit, OptionSupport::Unsupported);
assert_eq!(capabilities.after, OptionSupport::Supported);
assert_eq!(ListerCapabilities::builder().build(), ListerCapabilities::default());
assert_eq!(ListerCapabilities::default().sort, OptionSupport::Unknown);Fields§
§sort: OptionSupportNative --sort support. Supported sort keys and RDF mapping profiles
still depend on the program; this flag does not define a sorting grammar.
offset: OptionSupportNative --offset support, applied after sorting and before limiting.
before: OptionSupportNative --before support for an exclusive entry-ID cursor bound.
after: OptionSupportNative --after support for an exclusive entry-ID cursor bound.
limit: OptionSupportNative --limit support. A host can omit an unsupported native limit
while still enforcing the requested result count locally.
Implementations§
Source§impl ListerCapabilities
impl ListerCapabilities
Sourcepub fn builder() -> ListerCapabilitiesBuilder
pub fn builder() -> ListerCapabilitiesBuilder
Create an instance of ListerCapabilities using the builder syntax