Expand description
Stable API v1.
This is the primary public interface. All stable kernel APIs are accessed through this module. Stable Kernel API v1.
Linux equivalent: include/linux/
This module provides the stable public interface for drivers and modules. All types exported here are covered by semver guarantees within the v1.x series.
§Stability Guarantee
- Breaking changes require a new major version (v2)
- New APIs may be added in minor versions
- Patch versions contain only bug fixes
§Usage
ⓘ
use reovim_kernel::api::v1::*;
// Check API compatibility
check_api_version(Version::new(1, 0, 0))?;
// Use kernel types
let bus = EventBus::new();
pr_info!("kernel initialized");Modules§
- events
- Event type definitions for kernel and driver layers.
Macros§
- pr_
debug - Logs a message at the Debug level.
- pr_err
- Logs a message at the Error level.
- pr_info
- Logs a message at the Info level.
- pr_
trace - Logs a message at the Trace level.
- pr_warn
- Logs a message at the Warn level.
- profile
- Profile a scope and record to histogram (legacy macro).
- profile_
counter - Increment a counter metric via the global profiler.
- profile_
fn - Profile a function (uses module path as target).
- profile_
histogram - Record a histogram sample via the global profiler.
- profile_
scope - Profile a scope with the
Profilertrait.
Structs§
- Bounded
Receiver - Receiver for bounded MPSC channel (same as unbounded).
- Bounded
Sender - Sender for bounded MPSC channel.
- Buffer
- A text buffer with rope-based storage.
- Buffer
Id - Unique identifier for a buffer.
- Buffer
Snapshot - Read-only snapshot of buffer state.
- Cache
Updated - Cache update notification event.
- Command
Id - Namespaced command identifier.
- Command
Registration - Command registration descriptor.
- Condvar
- A Condition Variable
- Config
- Thread-safe configuration store.
- Config
Paths - Configuration path utilities.
- Counter
- Counter for tracking occurrences.
- Crash
Report - Crash report with all debugging info.
- Cursor
- Cursor state within a buffer.
- Debug
Context - Debug context collected during panic.
- Dispatch
Result - Result of dispatching with context.
- DynEvent
- Type-erased event wrapper for dynamic dispatch.
- Event
Bus - Type-erased event bus for pub/sub communication.
- Event
Handler Registration - Event handler registration descriptor.
- Event
Scope - GC-like synchronization for event lifecycle tracking.
- Event
Sender - Cloneable sender handle for emitting events via channel.
- Executor
- Task executor for synchronous task processing.
- Handler
Context - Context passed to event handlers during dispatch.
- Histogram
- Histogram for tracking value distributions.
- History
- Change history log.
- History
Entry - An entry in the change history.
- History
Ring - LIFO ring buffer for yank/delete history (numbered registers 0-255).
- Jump
Entry - A single entry in the jump list.
- Jumplist
- Jump list for tracking cursor position history.
- Kernel
Context - Kernel context bundling all kernel services.
- Kernel
State Snapshot - Snapshot of kernel state for debugging.
- Keybinding
Registration - Keybinding registration descriptor.
- Line
Cache - A generic line-based cache with hash-based validation.
- Mark
- A bookmark position with optional buffer association.
- Mark
Bank - Mark storage for all mark types.
- Mark
Snapshot - Snapshot of a single mark.
- Marks
Snapshot - Snapshot of all marks.
- Metrics
Registry - Metrics registry for named metrics.
- Metrics
Snapshot - Snapshot of all metrics at a point in time.
- ModeId
- Namespaced mode identifier with numeric discriminant.
- Mode
Stack - Mode stack for push/pop mode switching.
- Mode
Stack Snapshot - Snapshot of mode stack.
- Module
Context - Context provided to modules during initialization.
- Module
Id - Unique identifier for a loadable module.
- Module
Info - Static module metadata.
- Module
Probe - FFI-safe module probe for metadata discovery.
- Motion
Engine - Motion calculation engine.
- Multi
Service Registry - Registry for keyed services - multiple providers with typed key-based lookup.
- NopLogger
- No-op logger used when no logger is set.
- NopProfiler
- No-op profiler used when no profiler is set.
- Oneshot
Receiver - Receiver for oneshot channel.
- Oneshot
Sender - Sender for oneshot channel.
- Option
Constraint - Constraints for option value validation.
- Option
Registry - Thread-safe registry for all editor options.
- Option
Spec - Complete specification for an editor option.
- Parse
Level Error - Error returned when parsing a level from a string fails.
- Position
- A position within a text buffer.
- Priority
- Task execution priority.
- Priority
Queue - Priority queue for events.
- Profile
Guard Deprecated - RAII guard for timing a scope (legacy API).
- Profile
Scope - RAII guard for profiling a scope.
- Receiver
- Receiver for unbounded MPSC channel.
- Record
- A log record containing message and source location metadata.
- Record
Builder - Builder for constructing log records.
- Recovery
Snapshot - Recovery state snapshot.
- Recv
Error - Error returned when receiving fails because the channel is empty and closed.
- Register
Bank - Register storage for yank/paste operations.
- Register
Content - Content stored in a register.
- Register
Snapshot - Snapshot of a single register.
- Registers
Snapshot - Snapshot of all registers.
- Registration
Flags - Registration capability flags (Linux-inspired).
- Runtime
- Runtime event loop coordinator.
- Runtime
Config - Runtime configuration.
- Runtime
Stats - Runtime execution statistics.
- Saturation
Request - A request to the saturator with associated scope.
- Saturator
Config - Configuration for creating a saturator.
- Saturator
Handle - Handle to send work to a saturator.
- ScopeId
- Unique identifier for an
EventScope. - Selection
- Selection state within a buffer.
- Send
Error - Error returned when sending fails because the receiver was dropped.
- Sender
- Sender for unbounded MPSC channel.
- Service
Registry - Registry for unique services - one provider wins per service type.
- SetLogger
Error - Error returned when attempting to set the logger more than once.
- SetProfiler
Error - Error returned when attempting to set the profiler more than once.
- SetResult
- Result of a successful set operation.
- Snapshot
- A captured buffer state.
- Span
Data - Metadata for a profiling span.
- SpanId
- Unique identifier for a profiling span.
- Subscription
- RAII handle for event subscriptions.
- Subscription
Id - Unique identifier for a subscription.
- TabId
- Unique tab page identifier.
- Task
- A unit of deferred work.
- TaskId
- Unique task identifier.
- Text
Dimensions - Dimensions of text for OT position transformation.
- Text
Object Engine - Text object calculation engine.
- Timer
Config - Timer configuration.
- Timer
Handle - Handle to a scheduled timer with RAII cancellation.
- TimerId
- Unique timer identifier.
- Timer
Wheel - Timer wheel for managing scheduled timers.
- Transaction
- A transaction groups multiple edits for atomic undo/redo.
- Undo
Node - A node in the undo tree.
- Undo
Result - Result from an undo or redo operation.
- Undo
Tree - Undo tree with branching support.
- Unsaved
Buffer - Information about an unsaved buffer.
- Version
- Semantic version representation.
- Version
Error - Error returned when version compatibility check fails.
- Window
Id - Unique window identifier.
- Work
Queue - Work queue for deferred tasks.
Enums§
- Buffer
Error - Error type for buffer manager operations.
- Cache
Kind - The kind of cache that was updated.
- Char
Kind - Character classification for word boundary detection.
- Config
Error - Errors that can occur during configuration operations.
- Config
Value - Type-safe configuration value.
- Constraint
Error - Constraint validation error.
- Cursor
Style - Cursor display style.
- Direction
- Direction of cursor movement.
- Edit
- A single atomic edit operation.
- Edit
Origin - Origin of an edit for multi-client tracking (#471).
- Event
Result - Result of handling an event.
- Level
- Log level for kernel messages.
- Line
Position - Line position types for line-based motions.
- Mark
Result - Result of a mark lookup.
- Module
Error - Errors that can occur during module operations.
- Module
State - Module lifecycle state.
- Motion
- Motion types for cursor movement.
- Option
Error - Error type for option operations.
- Option
Scope - Scope where an option applies.
- Option
Scope Id - Runtime scope identifier for option access.
- Option
Value - Type-safe option value.
- Probe
Result - Result of module probe/initialization.
- Register
- Register addressing for the kernel register subsystem.
- Request
Priority - Request priority for background computation.
- Runtime
Command - Commands that can be sent to the runtime.
- Runtime
State - Runtime lifecycle state.
- Selection
Mode - Selection mode determining how text is selected.
- Special
Mark - Special mark types for automatic bookmarks.
- Task
State - Task execution state.
- Text
Object - Text object types for operator-pending mode.
- TryRecv
Error - Error returned when
try_recvfails. - TrySend
Error - Error returned when
try_sendfails. - Version
Error Kind - Kinds of version compatibility errors.
- Word
Boundary - Word boundary type for word motions.
- Word
Type - Word type for boundary detection.
- Yank
Type - Type of yank operation.
- Yank
Type Snapshot - Yank type for snapshot (mirrors
YankTypebut decoupled).
Constants§
- API_
VERSION - Current API version.
- API_
VERSION_ STR - Current API version as a string.
- DEFAULT_
BATCH_ SIZE - Default batch size for task execution.
- DEFAULT_
MAX_ TIMERS - Default maximum number of concurrent timers.
- DEFAULT_
PRIORITY_ QUEUE_ CAPACITY - Default priority queue capacity.
- DEFAULT_
TIMEOUT - Default timeout for scope waiting (3 seconds).
- DEFAULT_
WORK_ QUEUE_ CAPACITY - Default work queue capacity.
- MAX_
JUMPLIST_ SIZE - Maximum number of entries in the jump list.
- PRIORITY_
QUEUE_ DEFAULT_ CAPACITY - Default capacity for priority queue.
- WORK_
QUEUE_ DEFAULT_ CAPACITY - Default capacity for work queue.
- WORK_
QUEUE_ MAX_ CAPACITY - Maximum capacity (to prevent unbounded growth).
Traits§
- Buffer
Manager - Buffer manager interface for kernel-driver communication.
- Event
- Trait for all IPC events.
- Logger
- Logger trait - the kernel mechanism for logging.
- Mode
- Mode trait for type-safe, compile-time enforced mode ownership.
- Module
- Trait for all loadable modules.
- Profiler
- Profiler trait - kernel defines mechanism, drivers implement policy.
- Service
- Marker trait for services that can be registered in
ServiceRegistry. - Service
Key - Marker trait for typed service keys.
- Targeted
Event - Marker trait for events that target a specific component.
Functions§
- bounded
- Create a bounded MPSC channel with the specified capacity.
- channel
- Create an unbounded MPSC channel.
- char_
kind - Classify a character.
- check_
api_ version - Check if the current API version is compatible with the required version.
- cleanup_
old_ recovery_ files - Clean up old recovery files.
- delete_
end - Compute the end position of deleted text in the pre-delete buffer state.
- find_
delimiter_ pair - Find matching delimiter pair containing the given position.
- find_
matching_ delimiter - Find the matching delimiter for a delimiter at the given position.
- flush
- Flushes the global logger.
- generate_
crash_ report - Generate a crash report from panic info.
- install_
panic_ handler - Install the custom panic handler.
- is_
compatible - Check if
requiredversion is compatible withprovidedversion. - is_
handler_ installed - Check if the panic handler has been installed.
- list_
recovery_ files - List all recovery files.
- logger
- Returns the global logger.
- metrics
- Get the global metrics registry.
- next_
word_ end - Find the end of the next word.
- next_
word_ start - Find the start of the next word.
- oneshot
- Create a oneshot channel for single-value communication.
- profiler
- Get the global profiler.
- recovery_
dir - Get the recovery data directory.
- save_
buffer_ for_ recovery - Save buffer content to recovery directory.
- set_
debug_ context_ callback - Set the debug context callback.
- set_
logger - Sets the global logger.
- set_
profiler - Set the global profiler.
- set_
recovery_ callback - Set the recovery callback.
- snapshot_
kernel_ state - Create a kernel state snapshot from
KernelContext. - snapshot_
marks - Create a marks snapshot from
MarkBank. - snapshot_
mode_ stack - Create a mode stack snapshot from
ModeStack. - snapshot_
registers - Create a registers snapshot from
RegisterBank. - spawn_
saturator - Spawn a saturator with the given processor and completion callback.
- text_
dimensions - Compute the dimensions of a text string.
- transform_
position - Transform a position through the effect of an edit.
- word_
bounds - Find both word boundaries around a position.
- word_
end - Find the end of the word containing the given position.
- word_
start - Find the start of the word containing the given position.
Type Aliases§
- ArcSwap
- An atomic storage for
Arc. - Boxed
Task - Type-erased task function.
- Mutex
- A mutual exclusion primitive useful for protecting shared data
- Mutex
Guard - An RAII implementation of a “scoped lock” of a mutex. When this structure is dropped (falls out of scope), the lock will be unlocked.
- RwLock
- A reader-writer lock
- RwLock
Read Guard - RAII structure used to release the shared read access of a lock when dropped.
- RwLock
Write Guard - RAII structure used to release the exclusive write access of a lock when dropped.