Crates.io | print_typewriter |
lib.rs | print_typewriter |
version | 0.1.4 |
source | src |
created_at | 2023-02-07 06:30:44.392443 |
updated_at | 2023-02-08 07:25:49.955056 |
description | Provides an easy way to print strings on character at a time. |
homepage | |
repository | https://github.com/TheMrGong/print_typewriter |
max_upload_size | |
id | 778531 |
size | 14,512 |
Print Typewriter
Simple learning project for a Rust Library that lets you print strings character by character in a configurable way.
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);