pub enum Register {
Default,
Slot(char),
History(u8),
System,
Session(char),
PeerHistory {
client: usize,
index: u8,
},
}Expand description
Register addressing for the kernel register subsystem.
Represents storage locations using mechanism names (not editor-specific terminology). The kernel provides WHAT registers exist; modules decide HOW they map to user-facing keys.
§Storage Routing
Different variants are stored in different subsystems:
| Variant | Storage | Mutability |
|---|---|---|
Default | Per-client RegisterBank | Read/Write |
Slot(char) | Per-client RegisterBank | Read/Write |
History(u8) | Per-client HistoryRing | Read-only |
System | OS clipboard (driver) | Read/Write |
Session(char) | Session-level shared storage | Read/Write |
PeerHistory | Another client’s HistoryRing | Read-only |
§Example
use reovim_kernel::api::v1::Register;
let default = Register::Default;
assert!(default.is_bank_register());
assert!(!default.is_read_only());
let slot = Register::Slot('a');
assert!(slot.is_bank_register());
let history = Register::History(0);
assert!(history.is_read_only());
let session = Register::Session('A');
assert!(session.is_session_scoped());Variants§
Default
The default/fallback register.
Slot(char)
A keyed storage slot (a-z, 26 per-client slots).
History(u8)
Index into the per-client history ring (0-255).
System
System clipboard (OS-level).
Session(char)
Session-scoped shared register (A-Z, shared across all clients).
PeerHistory
Read another client’s history ring entry.
Implementations§
Source§impl Register
impl Register
Sourcepub const fn is_bank_register(&self) -> bool
pub const fn is_bank_register(&self) -> bool
Whether this register is stored in per-client RegisterBank.
Sourcepub const fn is_read_only(&self) -> bool
pub const fn is_read_only(&self) -> bool
Whether this register is read-only.
History and peer history registers cannot be written to directly. They are populated as side effects of other operations.
Sourcepub const fn is_session_scoped(&self) -> bool
pub const fn is_session_scoped(&self) -> bool
Whether this register requires session-level access.
Session registers and peer history both need access to shared session state rather than per-client state.