Skip to main content

Register

Enum Register 

Source
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:

VariantStorageMutability
DefaultPer-client RegisterBankRead/Write
Slot(char)Per-client RegisterBankRead/Write
History(u8)Per-client HistoryRingRead-only
SystemOS clipboard (driver)Read/Write
Session(char)Session-level shared storageRead/Write
PeerHistoryAnother client’s HistoryRingRead-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.

Fields

§client: usize

Target client identifier.

§index: u8

History ring index (0-255).

Implementations§

Source§

impl Register

Source

pub const fn is_bank_register(&self) -> bool

Whether this register is stored in per-client RegisterBank.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Clone for Register

Source§

fn clone(&self) -> Register

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Register

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for Register

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Register

Source§

fn eq(&self, other: &Register) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for Register

Source§

impl Eq for Register

Source§

impl StructuralPartialEq for Register

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.