1
0
mirror of synced 2026-04-19 06:48:39 +08:00

docs: highlight code blocks Rust readme.md

This commit is contained in:
AuroraTea
2022-12-17 22:26:21 +08:00
parent 1c321ad12b
commit e44b649522

View File

@@ -3,7 +3,7 @@
## 调用示例Rust
第1步**全局** 初始化(应用程序启动时执行一次):
```
```rust
// 创建 IdGeneratorOptions 对象,可在构造函数中输入 WorkerId
let mut options = IdGeneratorOptions::New(Your_Unique_Worker_Id);
// options.WorkerIdBitLength = 10; // 默认值6限定 WorkerId 最大值为2^6-1即默认最多支持64个节点。
@@ -18,9 +18,7 @@ YitIdHelper::SetIdGenerator(options);
```
第2步生成ID
```
```rust
// 初始化后在任何需要生成ID的地方调用以下方法
long newId = YitIdHelper::NextId();
```
```