Skip to main content

Crate hyle

Crate hyle 

Source
Expand description

Framework-agnostic forma and query planning primitives.

hyle deliberately has no React, DOM, async, or transport concepts. It describes models and fields, derives backend query manifests, and resolves raw backend sources into purified results plus lookup tables. UI frameworks should build thin adapters on top of these serializable structures.

Structs§

AdapterFiltersOptions
Options for a filters hook (e.g. use_filters) — framework-agnostic base.
AdapterFormOptions
Options for a form hook (e.g. use_form) — framework-agnostic base.
Blueprint
Column
Field
FieldChange
The result of a per-field change transform.
FieldOptions
FormErrors
Pre-rendered validation errors injected by a POST handler into the server context so that form pages can display them without JS.
Forma
FormaField
HyleDataField
A single resolved field value with a pre-built display renderer.
HyleFilterField
Metadata for a single filter input, pre-computed by a filters hook.
InputHint
Manifest
Model
ModelResult
MutateInput
The input passed to a mutation (create, update, or delete).
Purifier
Metadata-driven synchronous validator.
PurifyError
Query
Reference
ResolvedView
Output of Blueprint::resolve_and_view.
ShapeField
Sort
UseFormaOptions
Options for a forma hook (e.g. use_forma).

Enums§

Error
FieldType
FormaContext
Which rendering context to use when deriving a query from a forma.
FormaFieldType
How a forma field type is described in a runtime forma definition. Strings correspond to primitive names or entity names (for references).
HyleDataState
State returned by a data hook (e.g. use_data).
HyleManifestState
State returned by a manifest hook (e.g. use_manifest).
Primitive
SortType

Statics§

CSS
The default component stylesheet for hyle UI components.

Traits§

SyncRule
A synchronous custom validation rule, dispatched by name via the "purifyAs": "<rule_name>" field metadata key.

Functions§

apply_view
Apply id-filter, filter_rows, sort, and pagination to rows according to manifest.
display_value
display_value_from_outcome
Fallback display helper for when the blueprint is not available at the call site (e.g. a table cell renderer that only holds an [Outcome]).
filter_rows
forma_to_query
Derive a Query from a Forma definition.
is_single
Returns true when the outcome represents a single record — either because the query used method: "one" or because the source returned a single row (ModelRows::One).
make_field
Build a Field by kind name. Used by the WASM make_field export so the JS field builder helpers can delegate entirely to Rust.
parse_query_params
Parse a URL query string into (page, per_page, filters).
purify_row_sync
Convenience wrapper: validate with a default (no custom rules) Purifier. Used by the WASM export and for simple cases that don’t need custom rules.
row_from_form
Convert a URL-decoded form submission (IndexMap<String, String>) into a Row (IndexMap<String, Value>).
row_from_value
Extract a Row from a serde_json::Value that is expected to be an object.

Type Aliases§

FieldChangeFn
A single per-field transform function (render type erased to ()).
FieldChangeMap
A map of per-field transform functions keyed by field name.
HyleResult
Row
Source
Value