Expand description
Structured output envelopes, renderers, schemas, and field projection. Structured output envelopes and renderers.
Command handlers return JSON-serializable data and a backend system id. The
middleware wraps that data in an Envelope, applies filtering, pagination,
JMESPath expressions, field projection, and then renders the result as JSON,
human text, or TOON.
JSON is the default for the Rust crate. Human output is intended for terminal readability, and TOON remains available as an explicit migration format.
Re-exports§
pub use crate::error::DetailedError;pub use crate::error::ExitCoder;pub use crate::error::exit_code_for_error;pub use crate::error::exit_code_for_exit_coder;
Structs§
- Envelope
- Top-level output envelope rendered for successful and failed commands.
- Error
Envelope - Structured error payload in an
Envelope. - Field
Info - Compact field summary used in help text and schema output.
- Field
Tree - Parsed field-selection tree.
- Human
View Def - Human view definition keyed by schema id.
- Human
View Registry - Registry of human column and custom-renderer views.
- Human
View Renderer - Custom human renderer wrapper.
- Metadata
- Execution metadata attached to an
Envelope. - Next
Action - A suggested follow-up command the caller can run next.
- Next
Action Param - Metadata hint for a parameter in a
NextActioncommand template. - Output
Field - Manual output field descriptor.
- Pagination
Meta - Client-side pagination metadata.
- Pipeline
Opts - Options for the output pipeline.
- Renderer
Factory - Small rendering facade for callers that prefer an object-style renderer.
- Schema
Info - Schema information returned by
--schema. - Schema
Registry - Registry for command output schemas.
- Table
Column - Column definition for registered human table views.
Enums§
- Output
Format - Supported output formats.
Traits§
- Output
Schema - Trait for manually declared output schemas.
Functions§
- apply_
pipeline - Applies filter, pagination, expression, and field projection in framework order.
- build_
detailed_ error_ envelope - Builds an error envelope from a
DetailedError. - build_
error_ envelope - Builds an error envelope, preserving structured details from known error types.
- fields_
for - Converts an
OutputSchemaimplementation to compact field info. - fields_
from_ json_ schema - Extracts compact field summaries from a JSON Schema object.
- filter_
fields - Applies field projection to objects or arrays of objects.
- format_
help_ section - Formats compact field summaries for command long help.
- get_
global_ schema_ by_ path - Looks up a process-global schema by command path.
- global_
human_ view_ registry_ snapshot - Returns a snapshot of the process-global human view registry.
- global_
schema_ registry_ snapshot - Returns a snapshot of the process-global schema registry.
- is_
valid_ output_ format - Returns true when
formatis supported by the framework. - json_
schema_ for - Generates JSON Schema for a Rust type.
- json_
schema_ info - Builds schema info from a Rust type’s JSON Schema.
- lookup_
global_ human_ view_ columns - Looks up global columns for a schema id.
- lookup_
global_ human_ view_ func - Looks up a global custom renderer for a schema id.
- parse_
fields - Parses comma-separated field paths.
- register_
global_ human_ view - Registers a process-global column view.
- register_
global_ human_ view_ func - Registers a process-global custom human renderer.
- register_
global_ json_ schema - Registers a process-global JSON Schema.
- register_
global_ schema - Registers a process-global manual schema.
- register_
global_ schema_ fields - Registers process-global compact field summaries.
- register_
global_ schema_ info - Registers process-global schema info.
- render
- Renders an envelope in the requested format.
- render_
data - Wraps data in a success envelope and renders it.
- render_
data_ format - Parses an output format string, wraps data in a success envelope, and renders it.
- render_
detailed_ error - Wraps a detailed error in an error envelope and renders it.
- render_
detailed_ error_ format - Parses an output format string, wraps a detailed error, and renders it.
- render_
error - Wraps an error in an error envelope and renders it.
- render_
error_ format - Parses an output format string, wraps an error, and renders it.
- render_
format - Parses an output format string and renders an envelope.
- render_
human - Renders an envelope using generic human output.
- render_
human_ with_ registry - Renders an envelope using a human view registry.
- render_
human_ with_ registry_ for_ schema - Renders an envelope using registry entries for a specific schema id.
- render_
human_ with_ view - Renders an envelope using explicit table columns.
- render_
json - Renders an envelope as pretty JSON.
- render_
toon - Renders an envelope in the TOON migration format.
- write_
render - Writes rendered envelope output to a writer.
Type Aliases§
- Human
View Fn - Function used to render custom human output for a JSON value.