Skip to main content

Face

Trait Face 

Source
pub trait Face {
    // Required method
    fn label(&self) -> &str;

    // Provided method
    fn controls(&self) -> Vec<Control> { ... }
}
Expand description

One backend capability. A face exists only if swapping [Infra] swaps the implementation.

That rule caught two near-misses on the day it was written, both by measuring rather than by taste: FalkorDB is a URL passed around under EVERY infra, and object storage is the same embedded store under every infra. Neither is a choice, so neither is a face.

Required Methods§

Source

fn label(&self) -> &str

A short human name for the implementation actually in use ("Iceberg", "Postgres") — for an honest status line, never for a branch.

Provided Methods§

Source

fn controls(&self) -> Vec<Control>

The controls this face offers, as DATA. Postgres vends a connection string; Iceberg vends a warehouse path. This is why the settings BELOW an infra choice change when the choice does.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§