rotext_core 0.2.0

The core (no_std) part of the official and de facto Rotext parser.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#![cfg(feature = "block-id")]

use crate::types::BlockId;

pub struct BlockIdGenerator(usize);
impl BlockIdGenerator {
    pub fn new() -> Self {
        Self(0)
    }

    #[cfg(feature = "block-id")]
    pub fn pop(&mut self) -> BlockId {
        self.0 += 1;
        BlockId::new(self.0)
    }
}