edit-session
A small, toolkit-independent Rust library for preview, validation and commit
lifecycles. no_std, zero runtime dependencies, Rust 1.88+. MIT OR Apache-2.0.
Use it when several controls edit one draft and the host should commit one final change. The host owns validation, preview rendering, commands, undo and document identity. This crate does not provide widgets or an undo stack.
Installation
Add a published copy of this prerelease to your dependencies:
[]
= "=0.1.0-alpha.5"
This is an experimental alpha. Pin an exact version and keep Cargo.lock for
applications. Read the
compatibility policy
before upgrading. For other distribution options and current publication status,
see the project README.
Example
use EditSession;
let context = ;
let live_opacity = 100_u8;
let mut draft = new;
draft..unwrap;
draft..unwrap;
if let Some = draft.finish.unwrap
finish consumes the session. If the host command can reject a change and the UI
must retain the draft for retry, use the borrowed-preview/check pattern in the
tested recovery example.
Check the live value and context again on every attempt.
- API source and contracts
- Runnable example: Undo restores a value but leaves an old draft stale
- Changelog
- Integration evidence and limits
- Report a bug
The separate interaction-check runner is optional and is not a dependency of this crate.