Expand description
PTY runtime contracts and backends for Ailloli UI terminals.
This crate is intentionally separate from ailloli_ui_terminal_core: it owns
system I/O only. It does not parse ANSI, render widgets, or integrate with
application-specific UI. The default feature set provides models, batching,
a handle abstraction, and an in-memory mock without opening OS resources.
Feature portable adds the native PortablePtyBackend with detached worker
threads and unbounded queues documented on that feature-gated type.
§Examples
use ailloli_ui_terminal_pty::{MockPtyBackend, PtyBackend, PtyEvent, PtySpawnConfig};
let backend = MockPtyBackend::default();
backend.push_event(PtyEvent::Output(b"ready".to_vec()));
let handle = backend.spawn(PtySpawnConfig::default()).unwrap();
assert_eq!(handle.drain_events(), vec![PtyEvent::Output(b"ready".to_vec())]);Structs§
- Mock
PtyBackend - Cloneable mock backend with one shared recording state.
- Portable
PtyBackend - Native [
portable_pty] backend with configurable output batching. - PtyBatch
Config - Flush thresholds for
PtyOutputBatcher. - PtyExit
Status - Backend-reported process completion.
- PtyHandle
- Clonable, thread-safe capability for one erased PTY session.
- PtyOutput
Batcher - Single-threaded accumulator producing ordered
PtyEvent::Outputbatches. - PtySize
- PTY character-grid and optional pixel dimensions.
- PtySpawn
Config - Backend-neutral child process and PTY spawn configuration.
Enums§
- PtyError
- Failure returned by PTY abstraction operations.
- PtyEvent
- Event delivered asynchronously by a PTY session.
Traits§
- PtyBackend
- Factory for backend-specific PTY sessions.