Source code for bluebase.rm.type

from typing import Self

from dataclasses import (
    field as datafield,
    dataclass,
)

from bluebase.pf import (
    PfPageId,
    PfPageData,
)


__all__ = (
    'RmSlotId',
    'RmPageId',
    'RmRecordId',
    'RmRecordData',
    'RmRecord',
)


[docs] class RmSlotId(int): """ """
[docs] @classmethod def first(cls) -> Self: """ """ return cls(0)
[docs] def succ(self) -> Self: """ """ return type(self)(int(self) + 1)
[docs] class RmPageId(PfPageId): """ """ pass
[docs] @dataclass(frozen=True, slots=True) class RmRecordId: """ Attributes: pid: sid: """ pid: RmPageId sid: RmSlotId
[docs] class RmRecordData(PfPageData): """ """ pass
[docs] @dataclass(slots=True) class RmRecord: """ Attributes: rid: data: """ rid: RmRecordId data: RmRecordData = datafield(repr=False)