Skip to main content

Crate ftui_runtime

Crate ftui_runtime 

Source
Expand description

FrankenTUI Runtime

This crate provides the runtime components that tie together the core, render, and layout crates into a complete terminal application framework.

§Key Components

  • TerminalWriter - Unified terminal output coordinator with inline mode support
  • LogSink - Line-buffered writer for sanitized log output
  • Program - Bubbletea/Elm-style runtime for terminal applications
  • Model - Trait for application state and behavior
  • Cmd - Commands for side effects
  • Subscription - Trait for continuous event sources
  • Every - Built-in tick subscription

§Role in FrankenTUI

ftui-runtime is the orchestrator. It consumes input events from ftui-core, drives your Model::update, calls Model::view to render frames, and delegates rendering to ftui-render via TerminalWriter.

§How it fits in the system

The runtime is the center of the architecture: it is the bridge between input (ftui-core) and output (ftui-render). Widgets and layout are optional layers used by your view() to construct UI output.

Re-exports§

pub use asciicast::AsciicastRecorder;
pub use asciicast::AsciicastWriter;
pub use evidence_sink::EvidenceSink;
pub use evidence_sink::EvidenceSinkConfig;
pub use evidence_sink::EvidenceSinkDestination;
pub use evidence_telemetry::BudgetDecisionSnapshot;
pub use evidence_telemetry::ConformalSnapshot;
pub use evidence_telemetry::DiffDecisionSnapshot;
pub use evidence_telemetry::ResizeDecisionSnapshot;
pub use evidence_telemetry::budget_snapshot;
pub use evidence_telemetry::clear_budget_snapshot;
pub use evidence_telemetry::clear_diff_snapshot;
pub use evidence_telemetry::clear_resize_snapshot;
pub use evidence_telemetry::diff_snapshot;
pub use evidence_telemetry::resize_snapshot;
pub use evidence_telemetry::set_budget_snapshot;
pub use evidence_telemetry::set_diff_snapshot;
pub use evidence_telemetry::set_resize_snapshot;
pub use input_macro::EventRecorder;
pub use input_macro::FilteredEventRecorder;
pub use input_macro::InputMacro;
pub use input_macro::MacroPlayback;
pub use input_macro::MacroPlayer;
pub use input_macro::MacroRecorder;
pub use input_macro::RecordingFilter;
pub use input_macro::RecordingState;
pub use input_macro::TimedEvent;
pub use locale::LocaleContext;
pub use locale::LocaleOverride;
pub use locale::current_locale;
pub use locale::detect_system_locale;
pub use locale::set_locale;
pub use log_sink::LogSink;
pub use program::App;
pub use program::AppBuilder;
pub use program::BatchController;
pub use program::Cmd;
pub use program::EffectQueueConfig;
pub use program::FrameTiming;
pub use program::FrameTimingConfig;
pub use program::FrameTimingSink;
pub use program::InlineAutoRemeasureConfig;
pub use program::Model;
pub use program::PersistenceConfig;
pub use program::Program;
pub use program::ProgramConfig;
pub use program::ResizeBehavior;
pub use program::TaskSpec;
pub use program::WidgetRefreshConfig;
pub use render_trace::RenderTraceConfig;
pub use render_trace::RenderTraceContext;
pub use render_trace::RenderTraceFrame;
pub use render_trace::RenderTraceRecorder;
pub use simulator::ProgramSimulator;
pub use string_model::StringModel;
pub use string_model::StringModelAdapter;
pub use subscription::Every;
pub use subscription::StopSignal;
pub use subscription::SubId;
pub use subscription::Subscription;
pub use terminal_writer::ScreenMode;
pub use terminal_writer::TerminalWriter;
pub use terminal_writer::UiAnchor;
pub use voi_telemetry::clear_inline_auto_voi_snapshot;
pub use voi_telemetry::inline_auto_voi_snapshot;
pub use voi_telemetry::set_inline_auto_voi_snapshot;
pub use allocation_budget::AllocationBudget;
pub use allocation_budget::BudgetAlert;
pub use allocation_budget::BudgetConfig;
pub use allocation_budget::BudgetEvidence;
pub use allocation_budget::BudgetSummary;
pub use conformal_alert::AlertConfig;
pub use conformal_alert::AlertDecision;
pub use conformal_alert::AlertEvidence;
pub use conformal_alert::AlertReason;
pub use conformal_alert::AlertStats;
pub use conformal_alert::ConformalAlert;
pub use conformal_predictor::BucketKey;
pub use conformal_predictor::ConformalConfig;
pub use conformal_predictor::ConformalPrediction;
pub use conformal_predictor::ConformalPredictor;
pub use conformal_predictor::ConformalUpdate;
pub use conformal_predictor::DiffBucket;
pub use conformal_predictor::ModeBucket;
pub use eprocess_throttle::EProcessThrottle;
pub use eprocess_throttle::ThrottleConfig;
pub use eprocess_throttle::ThrottleDecision;
pub use eprocess_throttle::ThrottleLog;
pub use eprocess_throttle::ThrottleStats;
pub use flake_detector::EvidenceLog;
pub use flake_detector::FlakeConfig;
pub use flake_detector::FlakeDecision;
pub use flake_detector::FlakeDetector;
pub use flake_detector::FlakeSummary;
pub use reactive::BatchScope;
pub use reactive::Binding;
pub use reactive::BindingScope;
pub use reactive::Computed;
pub use reactive::Observable;
pub use reactive::TwoWayBinding;
pub use resize_coalescer::CoalesceAction;
pub use resize_coalescer::CoalescerConfig;
pub use resize_coalescer::CoalescerStats;
pub use resize_coalescer::CycleTimePercentiles;
pub use resize_coalescer::DecisionLog;
pub use resize_coalescer::DecisionSummary;
pub use resize_coalescer::Regime;
pub use resize_coalescer::ResizeCoalescer;
pub use resize_sla::ResizeEvidence;
pub use resize_sla::ResizeSlaMonitor;
pub use resize_sla::SlaConfig;
pub use resize_sla::SlaLogEntry;
pub use resize_sla::SlaSummary;
pub use resize_sla::make_sla_hooks;
pub use undo::CommandBatch;
pub use undo::CommandError;
pub use undo::CommandMetadata;
pub use undo::CommandResult;
pub use undo::CommandSource;
pub use undo::HistoryConfig;
pub use undo::HistoryManager;
pub use undo::MergeConfig;
pub use undo::TextDeleteCmd;
pub use undo::TextInsertCmd;
pub use undo::TextReplaceCmd;
pub use undo::Transaction;
pub use undo::TransactionScope;
pub use undo::UndoableCmd;
pub use undo::WidgetId;
pub use validation_pipeline::LedgerEntry;
pub use validation_pipeline::PipelineConfig;
pub use validation_pipeline::PipelineResult;
pub use validation_pipeline::PipelineSummary;
pub use validation_pipeline::ValidationOutcome;
pub use validation_pipeline::ValidationPipeline;
pub use validation_pipeline::ValidatorStats;
pub use voi_sampling::VoiConfig;
pub use voi_sampling::VoiDecision;
pub use voi_sampling::VoiLogEntry;
pub use voi_sampling::VoiObservation;
pub use voi_sampling::VoiSampler;
pub use voi_sampling::VoiSamplerSnapshot;
pub use voi_sampling::VoiSummary;
pub use state_persistence::MemoryStorage;
pub use state_persistence::RegistryStats;
pub use state_persistence::StateRegistry;
pub use state_persistence::StorageBackend;
pub use state_persistence::StorageError;
pub use state_persistence::StorageResult;
pub use state_persistence::StoredEntry;
pub use schedule_trace::CancelReason;
pub use schedule_trace::GoldenCompareResult;
pub use schedule_trace::IsomorphismProof;
pub use schedule_trace::ScheduleTrace;
pub use schedule_trace::SchedulerPolicy;
pub use schedule_trace::TaskEvent;
pub use schedule_trace::TraceConfig;
pub use schedule_trace::TraceEntry;
pub use schedule_trace::TraceSummary;
pub use schedule_trace::WakeupReason;
pub use schedule_trace::compare_golden;
pub use terminal_writer::RuntimeDiffConfig;

Modules§

allocation_budget
Sequential allocation leak detection using CUSUM and e-process.
asciicast
Asciicast v2 recorder for capturing terminal sessions.
bocpd
Bayesian Online Change-Point Detection (BOCPD) for Resize Regime Detection.
conformal_alert
Conformal alert threshold calibration with anytime-valid e-process control.
conformal_predictor
Conformal predictor for frame-time risk (bd-3e1t.3.2).
debug_trace
Zero-cost debug tracing controlled by environment variable.
eprocess_throttle
Anytime-valid throttle using e-process (test martingale) control.
evidence_sink
JSONL evidence sink for deterministic diagnostics.
evidence_telemetry
Evidence telemetry snapshots for runtime explainability overlays.
flake_detector
Anytime-Valid Flake Detector (bd-1plj).
input_fairness
Input Fairness Guard (bd-1rz0.17)
input_macro
Input macro recording and playback.
locale
Locale context provider for runtime-wide internationalization.
log_sink
Log sink for in-process output routing.
program
Bubbletea/Elm-style runtime for terminal applications.
queueing_scheduler
Queueing Theory Scheduler with SRPT/Smith-Rule Style Scheduling (bd-13pq.7).
reactive
Reactive data bindings for FrankenTUI.
render_trace
Render-trace recorder for deterministic replay (bd-3e1t.4.13).
resize_coalescer
Adaptive resize stream coalescer.
resize_sla
Resize SLA monitoring with conformal alerting (bd-1rz0.21).
schedule_trace
Schedule Trace Module (bd-gyi5).
simulator
Deterministic program simulator for testing.
state_persistence
Widget state persistence for save/restore across sessions.
string_model
Easy-mode adapter for string-based views.
subscription
Subscription system for continuous event sources.
terminal_writer
Terminal output coordinator with inline mode support.
undo
Undo/Redo command history framework.
validation_pipeline
Expected-cost validation ordering with Bayesian online learning.
voi_sampling
Value-of-Information (VOI) Sampling Policy for expensive measurements.
voi_telemetry
VOI debug telemetry snapshots for runtime introspection.

Macros§

bind
Create a direct Binding to an observable.
bind_map
Create a mapped Binding from an observable with a transform function.
bind_map2
Create a mapped Binding from two observables.
debug_trace
Conditionally print debug trace output to stderr.

Structs§

DiffStrategyConfig
Configuration for the diff strategy selector.
DiffStrategySelector
Bayesian diff strategy selector.
StrategyEvidence
Evidence supporting a strategy decision.

Enums§

DiffStrategy
The diff strategy to use for the current frame.

Type Aliases§

Locale
Locale identifier (e.g., "en", "en-US", "ru").