$ account vyfor
Rattles is a minimal, dependency-free Rust library for terminal spinners and throbbers. It provides a collection of preset animations (arrows, ASCII, braille, emoji) and a flexible API for driving them via time, ticks, or frame index. The library supports both std (with a global clock via `Instant`) and no_std environments, and includes a `rattle!` macro for defining custom spinners. The architecture uses const generics for direction control (forward/reverse) and compile-time keyframe storage, enabling zero-cost abstractions. It is designed for integration with TUI frameworks like Ratatui, demonstrated by the example. The codebase is well-structured, with clean separation of concerns: `rattler` (time-based), `ticked_rattler` (stateful tick-based), and presets modules. The library has no external dependencies (except dev-dependencies for examples), and the macros generate efficient, compile-time validated spinners.