rinput 0.1.0

一个简单的 rust 输入库
Documentation
  • Coverage
  • 80%
    8 out of 10 items documented2 out of 7 items with examples
  • Size
  • Source code size: 39.82 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.37 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • tbontb-iaq/rinput
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • tbontb-iaq

rinput

一个简单的输入库,允许你声明变量的同时读入变量的值

示例:

use rinput::input;

input!(a: u8, mut c: char, s: String);
println!("{a} {c} {s}");

注意:部分行为可能与 C++ 的 cin 不一致

TODO

  • 添加输出流

  • 使用类似 stdin() 的函数代替全局静态变量 rin

    • 需要等到 once_cell 进入 stable
  • 使用泛型特化代替 read_strread_char

    • 需要泛型特化进入 stable