Skip to main content

Module surface

Module surface 

Source
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§

SurfaceCaps
A surface’s advertised capabilities, as open metadata over Expr.

Enums§

SurfaceError
A reason a SurfaceCaps value could not be parsed from an Expr.

Constants§

CAPS_KIND
The kind tag of a serialized SurfaceCaps map.
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 SurfaceCaps for a well-known preset name.