fyi_msg

Crates.iofyi_msg
lib.rsfyi_msg
version1.2.0
sourcesrc
created_at2021-06-15 02:29:34.831397
updated_at2024-11-08 20:31:43.820118
descriptionSimple ANSI-formatted, prefixed messages for console printing.
homepage
repositoryhttps://github.com/Blobfolio/fyi
max_upload_size
id410210
size144,540
Josh (joshstoik1)

documentation

README

FYI Msg

docs.rs
crates.io ci deps.rs
license

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.

Examples

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.

Macros

Macro Equivalent
confirm!(…) Msg::new(MsgKind::Confirm, "Some question…").prompt()

Optional Features

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.
Commit count: 1531

cargo fmt