| Crates.io | fyi_msg |
| lib.rs | fyi_msg |
| version | 2.4.0 |
| created_at | 2021-06-15 02:29:34.831397+00 |
| updated_at | 2025-09-19 02:10:44.29694+00 |
| description | Simple ANSI-formatted, prefixed messages for console printing. |
| homepage | |
| repository | https://github.com/Blobfolio/fyi |
| max_upload_size | |
| id | 410210 |
| size | 177,630 |
This crate contains the objects providing the heart of the FYI command line application, namely Msg, a simple struct for status-like messages that can be easily printed to STDOUT or STDERR.
use fyi_msg::{Msg, MsgKind};
// One way.
Msg::new(MsgKind::Success, "You did it!")
.with_newline(true)
.print();
// Another equivalent way.
Msg::success("You did it!").print();
For more usage examples, check out the examples/msg demo, which covers just about every common use case.
| Macro | Equivalent |
|---|---|
confirm!(…) |
Msg::new(MsgKind::Confirm, "Some question…").prompt() |
| Feature | Description |
|---|---|
fitted |
Enables Msg::fitted for obtaining a slice trimmed to a specific display width. |
progress |
Enables Progless, a thread-safe CLI progress bar displayer. |
timestamps |
Enables timestamp-related methods and flags like Msg::with_timestamp. |