Skip to main content

SelectionResolver

Trait SelectionResolver 

Source
pub trait SelectionResolver:
    Send
    + Sync
    + Debug
    + 'static {
    // Required methods
    fn id(&self) -> &ResolverId;
    fn valid_values(&self) -> Result<IndexSet<SelectionItem>>;
    fn describe(&self) -> &str;

    // Provided method
    fn is_valid(&self, value: &SelectionItem) -> Result<bool> { ... }
}
Expand description

Resolves the set of valid values for one external selection.

Embedding systems implement this trait to plug their domain-specific catalogs (datasets, templates, …) into paramodel. The trait object lives outside the parameter algebra (see SRD-0004 D15): parameters hold only the opaque ResolverId, and the registry is consulted at plan-compilation / binding time.

Required Methods§

Source

fn id(&self) -> &ResolverId

Resolver identity.

Source

fn valid_values(&self) -> Result<IndexSet<SelectionItem>>

Current snapshot of valid values. Cheap to call; implementations may cache internally.

Source

fn describe(&self) -> &str

Human-readable description for UI / logs.

Provided Methods§

Source

fn is_valid(&self, value: &SelectionItem) -> Result<bool>

Membership test. The default delegates to Self::valid_values.

Implementors§