reovim_server/lib.rs
1#![cfg_attr(coverage_nightly, allow(unused_features))]
2#![cfg_attr(coverage_nightly, feature(coverage_attribute))]
3//! Reovim Server - the editing engine.
4//!
5//! This crate provides the server-side implementation of reovim:
6//! - Session management with shared state
7//! - Buffer operations via kernel
8//! - gRPC v2 protocol services
9//!
10//! # Architecture
11//!
12//! The server follows mechanism/policy separation (Unix philosophy):
13//! - **Server provides WHAT**: raw buffer data, cursor position, options
14//! - **Client decides HOW**: rendering, gutters, decorations, themes
15//!
16//! # Example
17//!
18//! ```ignore
19//! use reovim_server::{Server, ServerConfig};
20//!
21//! #[tokio::main]
22//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
23//! let config = ServerConfig::grpc(12540);
24//! let server = Server::new(config);
25//! server.run().await?;
26//! Ok(())
27//! }
28//! ```
29
30pub mod app;
31pub mod config;
32pub mod debug;
33pub mod registry;
34pub mod session;
35
36#[cfg(feature = "grpc")]
37pub mod grpc;
38
39mod server;
40#[cfg(feature = "grpc")]
41pub(crate) mod tick;
42
43// Public API
44pub use {
45 app::AppState,
46 config::{ServerConfig, TransportMode},
47 registry::{
48 CommandQuerySnapshot, CommandRegistry, KeyLookupResult, KeymapRegistry, ModeEntry,
49 ModeRegistry,
50 },
51 server::{Server, SessionFactory},
52 session::{
53 Session, SessionId, SessionRegistry, SessionState, SyntaxSessionState, SyntaxStreamState,
54 },
55};