Documentation

pbar

use aok::{Result, OK};
use static_init::constructor;
use pbar::pbar;
use tokio::time::Duration;

#[constructor(0)]
extern "C" fn init() {
  loginit::init()
}

#[tokio::test]
async fn test() -> Result<()> {
  let mut pbar = pbar(100);
  for i in 0..100 {
    if i % 5 == 0 {
      pbar.set_message(format!("set message {}", i));
    }
    pbar.inc(1);
    tokio::time::sleep(Duration::from_millis(50)).await;
  }
  OK
}

About

This project is an open-source component of i18n.site ⋅ Internationalization Solution.

关于

本项目为 i18n.site ⋅ 国际化解决方案 的开源组件。