print_typewriter

Crates.ioprint_typewriter
lib.rsprint_typewriter
version0.1.4
sourcesrc
created_at2023-02-07 06:30:44.392443
updated_at2023-02-08 07:25:49.955056
descriptionProvides an easy way to print strings on character at a time.
homepage
repositoryhttps://github.com/TheMrGong/print_typewriter
max_upload_size
id778531
size14,512
góngo (TheMrGong)

documentation

README

Print Typewriter

Simple learning project for a Rust Library that lets you print strings character by character in a configurable way.

Usage

Typing out "hello" with each character taking 10 milliseconds to be printed

use print_typewriter::{char_duration, println_typed};

let duration = char_duration!(default 10.ms);
println_typed!(duration, "hello");

Typing "hello world" with each word being typed instantly and each space taking 250 milliesconds

use print_typewriter::{char_duration, println_typed};

let duration = char_duration!(' '->250.ms);
println_typed!(duration, "hello");

Typing a formatted string, "hello {} world" with spaces taking 250 milliseconds, periods taking 1 second, and everything else taking 90

use print_typewriter::{char_duration, println_typed};

let duration = char_duration!(default 90.ms, ' '->250.ms, '.'->1.s);
let beans = "beans";
println_typed!(duration, "hello {} world", beans);
Commit count: 6

cargo fmt