Skip to main content

Infrastructure

Trait Infrastructure 

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

    // Provided method
    fn faces(&self) -> Vec<(&'static str, &dyn Face)> { ... }
}
Expand description

The swappable half of an app — hands out Faces, and is the only thing that knows which backend answered.

A None face is not a degraded state to apologise for: it is the REASON a surface does not exist. That is what replaces a is_spark_backend()-shaped predicate scattered across panes — the capability answers for itself, and there is nothing to keep in sync.

The concrete face traits (a relational/catalog face, a graph face) live with the app that defines the operations, because search and cypher are domain calls, not framework ones. What is shared is the SHAPE: ask, get Option<&dyn Face>, and never name the implementation.

Required Methods§

Source

fn label(&self) -> &str

Which infra this is, for an honest status line ("skade (embedded)").

Provided Methods§

Source

fn faces(&self) -> Vec<(&'static str, &dyn Face)>

Every face this infra offers, by name — the generic surface a settings pane, a robot driver or a status line can enumerate without knowing the app’s domain.

Apps add typed accessors (fn relation(&self) -> Option<&dyn RelationFace>) on their own trait; this is the untyped roster, so a pane can render “what does this backend actually offer” without a match.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§