Skip to main content

Crate flower_core

Crate flower_core 

Source
Expand description

flower-core — the frontend-neutral structural editing model for config files.

Given a config document’s bytes and format, it exposes a navigable tree of Rows (a projection of fig’s Value) plus structural navigation and path-addressed edits routed through fig’s lossless editor. It knows nothing about terminals, GUIs, or the filesystem — a frontend (flower-ratatui, a future flower-gpui, …) renders Model::rows and drives the model’s methods; the embedder owns file I/O.

Re-exports§

pub use backend::Backend;
pub use backend::BackendError;
pub use backend::EditOp;
pub use backend::FigBackend;
pub use format::detect;
pub use model::Mode;
pub use model::Model;
pub use schema::Constraint;
pub use schema::FieldRule;
pub use schema::FieldRuleExt;
pub use schema::Schema;
pub use tree::Row;
pub use tree::VKind;

Modules§

backend
The commit sink: what Model edits through.
format
Map a file path’s extension onto a fig::Format.
model
The frontend-neutral editor model and its structural operations.
schema
flower-core’s own constraint vocabulary, plugged into fig-schema’s generic rule engine.
tree
The navigable view of a config document: a flat list of Rows derived from fig’s Value tree.

Structs§

PathPat
A path pattern. Unlike a concrete Seg path it can reach every element of a sequence (SegPat::EachItem), every entry of a mapping (SegPat::AnyKey), or a whole subtree (SegPat::AnyDepth), so a rule can constrain each item of a list field (tags:, audience:) or everything beneath a key.
Presentation
Presentation hints for one field rule.
Term
One term of a controlled vocabulary.

Enums§

Cardinality
Whether a reference or list-shaped field holds one entry or many. Pure data shape — reused by an embedder’s own reference/relation constraint (prov’s spanning/cardinality concepts, for instance) without this crate needing to know what a “relation” is.
FieldType
The type a field expects. Drives type-directed parsing and widget choice.
Icon
A semantic icon hint. Frontends map to their own symbol set.
Seg
One step of a fig path: a mapping key or a sequence index. Owned (unlike fig::Segment<'a>, which borrows), so a path can outlive a single FFI call.
SegPat
One step of a PathPat.
Tint
A semantic tint hint. Frontends map to theme-adaptive colours.
Validation
The result of validating a value against a field’s constraint at commit time.