Skip to main content

Module v1

Module v1 

Source
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 Profiler trait.

Structs§

BoundedReceiver
Receiver for bounded MPSC channel (same as unbounded).
BoundedSender
Sender for bounded MPSC channel.
Buffer
A text buffer with rope-based storage.
BufferId
Unique identifier for a buffer.
BufferSnapshot
Read-only snapshot of buffer state.
CacheUpdated
Cache update notification event.
CommandId
Namespaced command identifier.
CommandRegistration
Command registration descriptor.
Condvar
A Condition Variable
Config
Thread-safe configuration store.
ConfigPaths
Configuration path utilities.
Counter
Counter for tracking occurrences.
CrashReport
Crash report with all debugging info.
Cursor
Cursor state within a buffer.
DebugContext
Debug context collected during panic.
DispatchResult
Result of dispatching with context.
DynEvent
Type-erased event wrapper for dynamic dispatch.
EventBus
Type-erased event bus for pub/sub communication.
EventHandlerRegistration
Event handler registration descriptor.
EventScope
GC-like synchronization for event lifecycle tracking.
EventSender
Cloneable sender handle for emitting events via channel.
Executor
Task executor for synchronous task processing.
HandlerContext
Context passed to event handlers during dispatch.
Histogram
Histogram for tracking value distributions.
History
Change history log.
HistoryEntry
An entry in the change history.
HistoryRing
LIFO ring buffer for yank/delete history (numbered registers 0-255).
JumpEntry
A single entry in the jump list.
Jumplist
Jump list for tracking cursor position history.
KernelContext
Kernel context bundling all kernel services.
KernelStateSnapshot
Snapshot of kernel state for debugging.
KeybindingRegistration
Keybinding registration descriptor.
LineCache
A generic line-based cache with hash-based validation.
Mark
A bookmark position with optional buffer association.
MarkBank
Mark storage for all mark types.
MarkSnapshot
Snapshot of a single mark.
MarksSnapshot
Snapshot of all marks.
MetricsRegistry
Metrics registry for named metrics.
MetricsSnapshot
Snapshot of all metrics at a point in time.
ModeId
Namespaced mode identifier with numeric discriminant.
ModeStack
Mode stack for push/pop mode switching.
ModeStackSnapshot
Snapshot of mode stack.
ModuleContext
Context provided to modules during initialization.
ModuleId
Unique identifier for a loadable module.
ModuleInfo
Static module metadata.
ModuleProbe
FFI-safe module probe for metadata discovery.
MotionEngine
Motion calculation engine.
MultiServiceRegistry
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.
OneshotReceiver
Receiver for oneshot channel.
OneshotSender
Sender for oneshot channel.
OptionConstraint
Constraints for option value validation.
OptionRegistry
Thread-safe registry for all editor options.
OptionSpec
Complete specification for an editor option.
ParseLevelError
Error returned when parsing a level from a string fails.
Position
A position within a text buffer.
Priority
Task execution priority.
PriorityQueue
Priority queue for events.
ProfileGuardDeprecated
RAII guard for timing a scope (legacy API).
ProfileScope
RAII guard for profiling a scope.
Receiver
Receiver for unbounded MPSC channel.
Record
A log record containing message and source location metadata.
RecordBuilder
Builder for constructing log records.
RecoverySnapshot
Recovery state snapshot.
RecvError
Error returned when receiving fails because the channel is empty and closed.
RegisterBank
Register storage for yank/paste operations.
RegisterContent
Content stored in a register.
RegisterSnapshot
Snapshot of a single register.
RegistersSnapshot
Snapshot of all registers.
RegistrationFlags
Registration capability flags (Linux-inspired).
Runtime
Runtime event loop coordinator.
RuntimeConfig
Runtime configuration.
RuntimeStats
Runtime execution statistics.
SaturationRequest
A request to the saturator with associated scope.
SaturatorConfig
Configuration for creating a saturator.
SaturatorHandle
Handle to send work to a saturator.
ScopeId
Unique identifier for an EventScope.
Selection
Selection state within a buffer.
SendError
Error returned when sending fails because the receiver was dropped.
Sender
Sender for unbounded MPSC channel.
ServiceRegistry
Registry for unique services - one provider wins per service type.
SetLoggerError
Error returned when attempting to set the logger more than once.
SetProfilerError
Error returned when attempting to set the profiler more than once.
SetResult
Result of a successful set operation.
Snapshot
A captured buffer state.
SpanData
Metadata for a profiling span.
SpanId
Unique identifier for a profiling span.
Subscription
RAII handle for event subscriptions.
SubscriptionId
Unique identifier for a subscription.
TabId
Unique tab page identifier.
Task
A unit of deferred work.
TaskId
Unique task identifier.
TextDimensions
Dimensions of text for OT position transformation.
TextObjectEngine
Text object calculation engine.
TimerConfig
Timer configuration.
TimerHandle
Handle to a scheduled timer with RAII cancellation.
TimerId
Unique timer identifier.
TimerWheel
Timer wheel for managing scheduled timers.
Transaction
A transaction groups multiple edits for atomic undo/redo.
UndoNode
A node in the undo tree.
UndoResult
Result from an undo or redo operation.
UndoTree
Undo tree with branching support.
UnsavedBuffer
Information about an unsaved buffer.
Version
Semantic version representation.
VersionError
Error returned when version compatibility check fails.
WindowId
Unique window identifier.
WorkQueue
Work queue for deferred tasks.

Enums§

BufferError
Error type for buffer manager operations.
CacheKind
The kind of cache that was updated.
CharKind
Character classification for word boundary detection.
ConfigError
Errors that can occur during configuration operations.
ConfigValue
Type-safe configuration value.
ConstraintError
Constraint validation error.
CursorStyle
Cursor display style.
Direction
Direction of cursor movement.
Edit
A single atomic edit operation.
EditOrigin
Origin of an edit for multi-client tracking (#471).
EventResult
Result of handling an event.
Level
Log level for kernel messages.
LinePosition
Line position types for line-based motions.
MarkResult
Result of a mark lookup.
ModuleError
Errors that can occur during module operations.
ModuleState
Module lifecycle state.
Motion
Motion types for cursor movement.
OptionError
Error type for option operations.
OptionScope
Scope where an option applies.
OptionScopeId
Runtime scope identifier for option access.
OptionValue
Type-safe option value.
ProbeResult
Result of module probe/initialization.
Register
Register addressing for the kernel register subsystem.
RequestPriority
Request priority for background computation.
RuntimeCommand
Commands that can be sent to the runtime.
RuntimeState
Runtime lifecycle state.
SelectionMode
Selection mode determining how text is selected.
SpecialMark
Special mark types for automatic bookmarks.
TaskState
Task execution state.
TextObject
Text object types for operator-pending mode.
TryRecvError
Error returned when try_recv fails.
TrySendError
Error returned when try_send fails.
VersionErrorKind
Kinds of version compatibility errors.
WordBoundary
Word boundary type for word motions.
WordType
Word type for boundary detection.
YankType
Type of yank operation.
YankTypeSnapshot
Yank type for snapshot (mirrors YankType but 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§

BufferManager
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.
ServiceKey
Marker trait for typed service keys.
TargetedEvent
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 required version is compatible with provided version.
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.
BoxedTask
Type-erased task function.
Mutex
A mutual exclusion primitive useful for protecting shared data
MutexGuard
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
RwLockReadGuard
RAII structure used to release the shared read access of a lock when dropped.
RwLockWriteGuard
RAII structure used to release the exclusive write access of a lock when dropped.