Expand description
Surface capability metadata – the library-level “surface” output position.
VIEW_4 frames a view as a codec at output position surface. The kernel
keeps its closed sim_kernel::EncodePosition (Eval/Quote/Data/
Pattern); the surface position lives here as OPEN metadata so a view/edit
lens projects toward a device described purely by capability data, never a
closed device enum. A surface advertises what it can show and accept; the
projection ranker (see crate::dispatch) reads those capabilities.
SurfaceCaps round-trips through a surface/caps tagged Expr map, the
same shape SIM uses for Scene and Intent values, so a
surface descriptor is itself an ordinary SIM value that can cross a session.
§Example
use sim_lib_view::surface;
let cli = surface::preset("cli").expect("cli is a known preset");
// Capabilities round-trip losslessly through their `surface/caps` Expr form.
let back = surface::SurfaceCaps::from_expr(&cli.to_expr()).unwrap();
assert_eq!(cli, back);
assert!(cli.input_flag("keyboard"));Structs§
- Surface
Caps - A surface’s advertised capabilities, as open metadata over
Expr.
Enums§
- Surface
Error - A reason a
SurfaceCapsvalue could not be parsed from anExpr.
Constants§
- CAPS_
KIND - The
kindtag of a serializedSurfaceCapsmap. - SURFACE_
NAMESPACE - The metadata namespace for surface descriptors (
surface/...). - SURFACE_
PRESETS - The catalog of well-known surface presets, by unqualified name.
Functions§
- preset
- Returns the baseline
SurfaceCapsfor a well-known preset name.