pos_next

Crates.iopos_next
lib.rspos_next
version0.1.5
sourcesrc
created_at2024-07-24 14:31:44.712131
updated_at2024-08-17 13:12:23.455114
descriptionpos_next
homepagehttps://github.com/i18n-site/rust/tree/main/pos_next
repositoryhttps://github.com/i18n-site/rust.git
max_upload_size
id1314058
size4,814
i18n.site (i18nsite)

documentation

README

pos_next

一个不同线程之间可以共享的 pos , 用了不安全代码, 不保证数字的连续性

use aok::{Result, OK};
use pos_next::PosNext;
use static_init::constructor;
use tracing::info;

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

#[test]
fn test() -> Result<()> {
  let p = PosNext::new();
  info!("{}", p.next());
  info!("{}", p.next());
  info!("{}", p.next());
  info!("{}", p.next());
  OK
}

About

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

关于

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

Commit count: 22

cargo fmt